Skip to content

Commit

Permalink
Migration fix for SQLite
Browse files Browse the repository at this point in the history
  • Loading branch information
fulopattila122 committed Jul 10, 2024
1 parent c8cb02f commit 55fbf39
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

return new class () extends Migration {
Expand All @@ -18,9 +19,11 @@ public function up(): void

public function down(): void
{
Schema::table('link_groups', function (Blueprint $table) {
$table->dropForeign('link_groups_root_item_id_foreign');
});
if ('sqlite' !== DB::connection()->getDriverName()) {
Schema::table('link_groups', function (Blueprint $table) {
$table->dropForeign('link_groups_root_item_id_foreign');
});
}

Schema::table('link_groups', function (Blueprint $table) {
$table->dropColumn('root_item_id');
Expand Down

0 comments on commit 55fbf39

Please sign in to comment.