From 86b854c162227f13d32f7219beffee5d9fa853e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20St=C3=B6ckel?= Date: Mon, 11 Mar 2024 19:55:04 +0100 Subject: [PATCH] =?UTF-8?q?SQLite=20doesn't=20support=20multiple=20calls?= =?UTF-8?q?=20to=20dropColumn=20/=20renameColumn=20in=20a=20single=20modif?= =?UTF-8?q?ication.=20(=E2=95=AF=C2=B0=E2=96=A1=C2=B0)=E2=95=AF=EF=B8=B5?= =?UTF-8?q?=20=E2=94=BB=E2=94=81=E2=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...00_add_origin_and_destination_id_to_trips.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/database/migrations/2024_03_11_000000_add_origin_and_destination_id_to_trips.php b/database/migrations/2024_03_11_000000_add_origin_and_destination_id_to_trips.php index ce51729eb..e719a68bb 100644 --- a/database/migrations/2024_03_11_000000_add_origin_and_destination_id_to_trips.php +++ b/database/migrations/2024_03_11_000000_add_origin_and_destination_id_to_trips.php @@ -5,6 +5,10 @@ use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; +/** + * "SQLite doesn't support multiple calls to dropColumn / renameColumn in a single modification." + * -> so small steps here. (╯°□°)╯︵ ┻━┻ + */ return new class extends Migration { public function up(): void { @@ -24,9 +28,11 @@ public function up(): void { Schema::table('hafas_trips', static function(Blueprint $table) { $table->dropForeign(['origin']); - $table->dropForeign(['destination']); - $table->dropColumn('origin'); + }); + + Schema::table('hafas_trips', static function(Blueprint $table) { + $table->dropForeign(['destination']); $table->dropColumn('destination'); }); @@ -53,9 +59,11 @@ public function down(): void { Schema::table('hafas_trips', static function(Blueprint $table) { $table->dropForeign(['origin_id']); - $table->dropForeign(['destination_id']); - $table->dropColumn('origin_id'); + }); + + Schema::table('hafas_trips', static function(Blueprint $table) { + $table->dropForeign(['destination_id']); $table->dropColumn('destination_id'); });