Skip to content

Commit

Permalink
SQLite doesn't support multiple calls to dropColumn / renameColumn in…
Browse files Browse the repository at this point in the history
… a single modification. (╯°□°)╯︵ ┻━┻
  • Loading branch information
MrKrisKrisu committed Mar 11, 2024
1 parent 1047f57 commit 86b854c
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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');
});

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

Expand Down

0 comments on commit 86b854c

Please sign in to comment.