refactor(migrations): use RuntimeException for irreversible uuidv7 migrations [AUD-DB-002]

This commit is contained in:
Jérémy Munsch 2026-08-26 11:19:50 +02:00
parent 30077e68ad
commit 23682def0d
No known key found for this signature in database
GPG key ID: 2AAECDA6B7330F91
4 changed files with 24 additions and 4 deletions

View file

@ -39,9 +39,14 @@ return new class () extends Migration
Schema::enableForeignKeyConstraints();
}
/**
* @throws \RuntimeException
*/
public function down(): void
{
throw new \Error('WONT ROLLBACK');
throw new \RuntimeException(
'This migration is irreversible: the transformation of products from integer IDs to UUIDv7 cannot be rolled back.'
);
}
private function dropForeignKeysForColumn(string $tableName, string $columnName): void

View file

@ -30,9 +30,14 @@ return new class () extends Migration
Schema::enableForeignKeyConstraints();
}
/**
* @throws \RuntimeException
*/
public function down(): void
{
throw new \Error('WONT ROLLBACK');
throw new \RuntimeException(
'This migration is irreversible: the transformation of orders from integer IDs to UUIDv7 cannot be rolled back.'
);
}
private function dropForeignKeysForColumn(string $tableName, string $columnName): void

View file

@ -31,9 +31,14 @@ return new class () extends Migration
Schema::enableForeignKeyConstraints();
}
/**
* @throws \RuntimeException
*/
public function down(): void
{
throw new \Error('WONT ROLLBACK');
throw new \RuntimeException(
'This migration is irreversible: the transformation of customers from integer IDs to UUIDv7 cannot be rolled back.'
);
}
private function dropForeignKeysForColumn(string $tableName, string $columnName): void

View file

@ -47,9 +47,14 @@ return new class () extends Migration
Schema::enableForeignKeyConstraints();
}
/**
* @throws \RuntimeException
*/
public function down(): void
{
throw new \Error('WONT ROLLBACK');
throw new \RuntimeException(
'This migration is irreversible: the transformation of shops and pickup exceptions from integer IDs to UUIDv7 cannot be rolled back.'
);
}
private function dropForeignKeysForColumn(string $tableName, string $columnName): void