mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
solve migration issue
This commit is contained in:
@ -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();
|
||||
}
|
||||
|
||||
@ -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');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user