mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-22 08:28:35 +00:00
27 lines
785 B
TypeScript
27 lines
785 B
TypeScript
import { MigrationInterface, QueryRunner, TableColumn, TableForeignKey } from 'typeorm';
|
|
|
|
export class AddPromotedFromToVersions1699893808728 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.addColumn(
|
|
'app_versions',
|
|
new TableColumn({
|
|
name: 'promoted_from',
|
|
type: 'uuid',
|
|
isNullable: true,
|
|
})
|
|
);
|
|
|
|
await queryRunner.createForeignKey(
|
|
'app_versions',
|
|
new TableForeignKey({
|
|
columnNames: ['promoted_from'],
|
|
referencedColumnNames: ['id'],
|
|
referencedTableName: 'app_environments',
|
|
})
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.dropColumn('app_versions', 'promoted_from');
|
|
}
|
|
}
|