solve migration issue

This commit is contained in:
jayvirsinh_gohil
2021-12-08 15:39:14 +05:30
parent 102a3a809d
commit 77ce1d7431
2 changed files with 2 additions and 1 deletions

View File

@ -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();
}

View File

@ -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');
});