Skip to content

Commit 2e9764f

Browse files
committed
fix migrations
1 parent 894489c commit 2e9764f

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

database/migrations/2025_10_18_174616_add_cluster_physical_server.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88
return new class extends Migration
99
{
10-
// SQLite ne gère pas les DDL en transaction -> off
11-
public $withinTransaction = false;
12-
13-
/ **
10+
/**
1411
* Create the cluster_physical_server pivot table, migrate existing cluster associations into it,
1512
* and remove the legacy `cluster_id` column and its related constraints/indexes from physical_servers.
1613
*

database/migrations/2025_10_18_183453_add_cluster_router.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
return new class extends Migration
99
{
10-
// DDL non transactionnel pour SQLite & co
11-
public bool $withinTransaction = false;
1210

1311
/**
1412
* Apply migration: create the cluster_router pivot, migrate existing router->cluster relations into it, and remove the routers.cluster_id column and its constraints/indexes.

database/migrations/2025_10_27_104704_add_fields_security_device.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public function up(): void
1616
$table->unsignedInteger('icon_id')
1717
->after('attributes')
1818
->nullable()
19-
->index('document_id_fk_493827312');
20-
$table->foreign('icon_id', 'document_id_fk_493827312')
19+
->index();
20+
$table->foreign('icon_id')
2121
->references('id')
2222
->on('documents');
2323
});
@@ -28,8 +28,8 @@ public function up(): void
2828
$table->unsignedInteger('icon_id')
2929
->after('attributes')
3030
->nullable()
31-
->index('document_id_fk_432938439');
32-
$table->foreign('icon_id', 'document_id_fk_43948313')
31+
->index();
32+
$table->foreign('icon_id')
3333
->references('id')
3434
->on('documents');
3535
});
@@ -43,15 +43,15 @@ public function down(): void
4343

4444
Schema::table('physical_security_devices', function (Blueprint $table) {
4545
if (DB::getDriverName() !== 'sqlite') {
46-
$table->dropForeign('document_id_fk_493827312');
46+
$table->dropForeign('icon_id');
4747
}
4848
$table->dropColumn('icon_id');
4949
$table->dropColumn('attributes');
5050
});
5151

5252
Schema::table('security_devices', function (Blueprint $table) {
5353
if (DB::getDriverName() !== 'sqlite') {
54-
$table->dropForeign('document_id_fk_43948313');
54+
$table->dropForeign('icon_id');
5555
}
5656
$table->dropColumn('icon_id');
5757
$table->dropColumn('attributes');

0 commit comments

Comments
 (0)