LocChat/server/database/migrations/1641570023672-AddContextIdToUserRole.ts
2022-01-07 10:19:34 -07:00

19 lines
572 B
TypeScript

import { MigrationInterface, QueryRunner, TableColumn } from 'typeorm';
export class AddContextIdToUserRole1641570023672 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.addColumn(
'user_role',
new TableColumn({
name: 'contextId',
type: 'text',
default: "'root'", // default values must include single quotes for text
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropColumn('user_role', 'contextId');
}
}