diff --git a/database/migrations/2020_12_02_090527_update_crater_version_400.php b/database/migrations/2020_12_02_090527_update_crater_version_400.php index 9520b200..1fc96f76 100644 --- a/database/migrations/2020_12_02_090527_update_crater_version_400.php +++ b/database/migrations/2020_12_02_090527_update_crater_version_400.php @@ -38,7 +38,7 @@ class UpdateCraterVersion400 extends Migration // Update user's addresses if ($user->addresses()->exists()) { foreach ($user->addresses as $address) { - $address->company_id = $user->companies()->first()->id; + $address->company_id = $user->company_id; $address->user_id = null; $address->save(); } diff --git a/database/migrations/2021_06_28_120231_add_customer_id_to_payments_table.php b/database/migrations/2021_06_28_120231_add_customer_id_to_payments_table.php index 96675b9d..38d4a6ab 100644 --- a/database/migrations/2021_06_28_120231_add_customer_id_to_payments_table.php +++ b/database/migrations/2021_06_28_120231_add_customer_id_to_payments_table.php @@ -14,6 +14,7 @@ class AddCustomerIdToPaymentsTable extends Migration public function up() { Schema::table('payments', function (Blueprint $table) { + $table->unsignedBigInteger('user_id')->nullable(); $table->unsignedBigInteger('customer_id')->nullable(); $table->foreign('customer_id')->references('id')->on('customers'); });