1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-17 16:42:48 +01:00

Fix for migration

This commit is contained in:
Hillel Coren 2017-01-03 12:11:31 +02:00
parent 10bad5dd9d
commit 92a26092b3

View File

@ -29,26 +29,28 @@ class AddInvoiceSignature extends Migration
$table->string('utm_content')->nullable(); $table->string('utm_content')->nullable();
}); });
Schema::table('payment_methods', function($table) if (Utils::isNinja()) {
{ Schema::table('payment_methods', function($table)
$table->unsignedInteger('account_gateway_token_id')->nullable()->change(); {
$table->dropForeign('payment_methods_account_gateway_token_id_foreign'); $table->unsignedInteger('account_gateway_token_id')->nullable()->change();
}); $table->dropForeign('payment_methods_account_gateway_token_id_foreign');
});
Schema::table('payment_methods', function($table) Schema::table('payment_methods', function($table)
{ {
$table->foreign('account_gateway_token_id')->references('id')->on('account_gateway_tokens')->onDelete('cascade'); $table->foreign('account_gateway_token_id')->references('id')->on('account_gateway_tokens')->onDelete('cascade');
}); });
Schema::table('payments', function($table) Schema::table('payments', function($table)
{ {
$table->dropForeign('payments_payment_method_id_foreign'); $table->dropForeign('payments_payment_method_id_foreign');
}); });
Schema::table('payments', function($table) Schema::table('payments', function($table)
{ {
$table->foreign('payment_method_id')->references('id')->on('payment_methods')->onDelete('cascade');; $table->foreign('payment_method_id')->references('id')->on('payment_methods')->onDelete('cascade');;
}); });
}
} }
} }