mirror of
https://github.com/pelican-dev/panel.git
synced 2025-06-21 15:51:08 +02:00
Use new migration logic
This commit is contained in:
parent
9ba8c1df9b
commit
906d4a7d28
@ -31,6 +31,9 @@ return new class extends Migration
|
|||||||
$table->dropIndex('permissions_server_id_foreign');
|
$table->dropIndex('permissions_server_id_foreign');
|
||||||
$table->dropForeign('permissions_user_id_foreign');
|
$table->dropForeign('permissions_user_id_foreign');
|
||||||
$table->dropIndex('permissions_user_id_foreign');
|
$table->dropIndex('permissions_user_id_foreign');
|
||||||
|
} else {
|
||||||
|
$table->dropForeign(['server_id']);
|
||||||
|
$table->dropForeign(['user_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->dropColumn('server_id');
|
$table->dropColumn('server_id');
|
||||||
|
@ -12,10 +12,7 @@ return new class extends Migration
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::table('servers', function (Blueprint $table) {
|
Schema::table('servers', function (Blueprint $table) {
|
||||||
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
|
$table->dropForeign(['pack_id']);
|
||||||
$table->dropForeign(['pack_id']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$table->dropColumn('pack_id');
|
$table->dropColumn('pack_id');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -30,14 +30,15 @@ return new class extends Migration
|
|||||||
Schema::table('eggs', function (Blueprint $table) {
|
Schema::table('eggs', function (Blueprint $table) {
|
||||||
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
|
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
|
||||||
$table->dropForeign('service_options_nest_id_foreign');
|
$table->dropForeign('service_options_nest_id_foreign');
|
||||||
|
} else {
|
||||||
|
$table->dropForeign(['nest_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$table->dropColumn('nest_id');
|
$table->dropColumn('nest_id');
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('servers', function (Blueprint $table) {
|
Schema::table('servers', function (Blueprint $table) {
|
||||||
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
|
$table->dropForeign(['nest_id']);
|
||||||
$table->dropForeign('servers_nest_id_foreign');
|
|
||||||
}
|
|
||||||
$table->dropColumn('nest_id');
|
$table->dropColumn('nest_id');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -27,10 +27,7 @@ return new class extends Migration
|
|||||||
}
|
}
|
||||||
|
|
||||||
Schema::table('nodes', function (Blueprint $table) {
|
Schema::table('nodes', function (Blueprint $table) {
|
||||||
if (Schema::getConnection()->getDriverName() !== 'sqlite') {
|
$table->dropForeign(['location_id']);
|
||||||
$table->dropForeign('nodes_location_id_foreign');
|
|
||||||
}
|
|
||||||
|
|
||||||
$table->dropColumn('location_id');
|
$table->dropColumn('location_id');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -43,15 +43,8 @@ return new class extends Migration
|
|||||||
$server->save();
|
$server->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
Schema::table('servers', function (Blueprint $table) {
|
|
||||||
$table->dropForeign(['allocation_id']);
|
|
||||||
});
|
|
||||||
} catch (Throwable) {
|
|
||||||
// pass for databases that don't support this like sqlite
|
|
||||||
}
|
|
||||||
|
|
||||||
Schema::table('servers', function (Blueprint $table) {
|
Schema::table('servers', function (Blueprint $table) {
|
||||||
|
$table->dropForeign(['allocation_id']);
|
||||||
$table->dropUnique(['allocation_id']);
|
$table->dropUnique(['allocation_id']);
|
||||||
$table->dropColumn(['allocation_id']);
|
$table->dropColumn(['allocation_id']);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user