generated from bastian/boilerplate
mvp
This commit is contained in:
@@ -4,13 +4,17 @@ export class AddRoleDescription1720000002000 implements MigrationInterface {
|
||||
name = 'AddRoleDescription1720000002000';
|
||||
|
||||
async up(queryRunner: QueryRunner): Promise<void> {
|
||||
if (await queryRunner.hasColumn('roles', 'description')) {
|
||||
return;
|
||||
}
|
||||
await queryRunner.query(`
|
||||
ALTER TABLE roles
|
||||
ADD description varchar(255) NOT NULL DEFAULT ''
|
||||
`);
|
||||
}
|
||||
|
||||
async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query('ALTER TABLE roles DROP COLUMN description');
|
||||
async down(): Promise<void> {
|
||||
// The current baseline schema already owns this column. Removing it here
|
||||
// would corrupt databases created by InitialSchema1720000000000.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user