From 0e0ef1d99e18c71abf6df3af70e2c6f829ef106a Mon Sep 17 00:00:00 2001 From: jayvirsinh_gohil Date: Thu, 24 Jun 2021 13:39:35 +0530 Subject: [PATCH] drop foreign issue solved --- ...remove_template_id_from_invoices_and_estimates_table.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/database/migrations/2020_12_14_051450_remove_template_id_from_invoices_and_estimates_table.php b/database/migrations/2020_12_14_051450_remove_template_id_from_invoices_and_estimates_table.php index 6802b30f..651136c6 100644 --- a/database/migrations/2020_12_14_051450_remove_template_id_from_invoices_and_estimates_table.php +++ b/database/migrations/2020_12_14_051450_remove_template_id_from_invoices_and_estimates_table.php @@ -25,6 +25,9 @@ class RemoveTemplateIdFromInvoicesAndEstimatesTable extends Migration }); Schema::table('invoices', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign(['invoice_template_id']); + } $table->dropColumn('invoice_template_id'); }); } @@ -39,6 +42,9 @@ class RemoveTemplateIdFromInvoicesAndEstimatesTable extends Migration }); Schema::table('estimates', function (Blueprint $table) { + if (config('database.default') !== 'sqlite') { + $table->dropForeign(['estimate_template_id']); + } $table->dropColumn('estimate_template_id'); }); }