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'); }); }