generated from bastian/boilerplate
21 lines
632 B
TypeScript
21 lines
632 B
TypeScript
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
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(): Promise<void> {
|
|
// The current baseline schema already owns this column. Removing it here
|
|
// would corrupt databases created by InitialSchema1720000000000.
|
|
}
|
|
}
|