refactor(migrations): use RuntimeException for irreversible uuidv7 migrations [AUD-DB-002]
This commit is contained in:
parent
30077e68ad
commit
23682def0d
4 changed files with 24 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue