From 0d56b7d251d22b99640ae8c691f0a876d814e1dc Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 28 Dec 2024 07:39:39 +0100 Subject: [PATCH] Ignore error. Must test more with sqlite. --- database/migrations/2024_11_30_075826_multi_piggy.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/database/migrations/2024_11_30_075826_multi_piggy.php b/database/migrations/2024_11_30_075826_multi_piggy.php index bcd6cee9bc..09faaebcea 100644 --- a/database/migrations/2024_11_30_075826_multi_piggy.php +++ b/database/migrations/2024_11_30_075826_multi_piggy.php @@ -15,7 +15,11 @@ return new class () extends Migration { // make account_id nullable and the relation also nullable. Schema::table('piggy_banks', static function (Blueprint $table): void { // 1. drop index - $table->dropForeign('piggy_banks_account_id_foreign'); + try { + $table->dropForeign('piggy_banks_account_id_foreign'); + } catch(RuntimeException $e) { + // do nothing. + } }); Schema::table('piggy_banks', static function (Blueprint $table): void { // 2. make column nullable.