mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix for database migration
This commit is contained in:
parent
a99079da95
commit
b2c93897ed
@ -46,11 +46,15 @@ class CreateGatewayTypes extends Migration
|
|||||||
$table->unsignedInteger('gateway_type_id')->nullable();
|
$table->unsignedInteger('gateway_type_id')->nullable();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// http://laravel.io/forum/09-18-2014-foreign-key-not-saving-in-migration
|
||||||
|
DB::statement('SET FOREIGN_KEY_CHECKS=0;');
|
||||||
Schema::table('payment_types', function($table)
|
Schema::table('payment_types', function($table)
|
||||||
{
|
{
|
||||||
$table->foreign('gateway_type_id')->references('id')->on('gateway_types')->onDelete('cascade');
|
$table->foreign('gateway_type_id')->references('id')->on('gateway_types')->onDelete('cascade');
|
||||||
});
|
});
|
||||||
|
DB::statement('SET FOREIGN_KEY_CHECKS=1;');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user