From 92a26092b3e05cdf2b66c87bc5ff5b2eeb42731d Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 3 Jan 2017 12:11:31 +0200 Subject: [PATCH] Fix for migration --- ...016_11_03_113316_add_invoice_signature.php | 36 ++++++++++--------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/database/migrations/2016_11_03_113316_add_invoice_signature.php b/database/migrations/2016_11_03_113316_add_invoice_signature.php index 34e4255274..2f5a71549b 100644 --- a/database/migrations/2016_11_03_113316_add_invoice_signature.php +++ b/database/migrations/2016_11_03_113316_add_invoice_signature.php @@ -29,26 +29,28 @@ class AddInvoiceSignature extends Migration $table->string('utm_content')->nullable(); }); - Schema::table('payment_methods', function($table) - { - $table->unsignedInteger('account_gateway_token_id')->nullable()->change(); - $table->dropForeign('payment_methods_account_gateway_token_id_foreign'); - }); + 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'); + }); - Schema::table('payment_methods', function($table) - { - $table->foreign('account_gateway_token_id')->references('id')->on('account_gateway_tokens')->onDelete('cascade'); - }); + Schema::table('payment_methods', function($table) + { + $table->foreign('account_gateway_token_id')->references('id')->on('account_gateway_tokens')->onDelete('cascade'); + }); - Schema::table('payments', function($table) - { - $table->dropForeign('payments_payment_method_id_foreign'); - }); + Schema::table('payments', function($table) + { + $table->dropForeign('payments_payment_method_id_foreign'); + }); - Schema::table('payments', function($table) - { - $table->foreign('payment_method_id')->references('id')->on('payment_methods')->onDelete('cascade');; - }); + Schema::table('payments', function($table) + { + $table->foreign('payment_method_id')->references('id')->on('payment_methods')->onDelete('cascade');; + }); + } } }