mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
27 lines
751 B
TypeScript
27 lines
751 B
TypeScript
|
|
import { MigrationInterface, QueryRunner, TableColumn, TableForeignKey } from 'typeorm';
|
||
|
|
|
||
|
|
export class AddAppVersionIdColumnToDataQueries1675368628629 implements MigrationInterface {
|
||
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||
|
|
await queryRunner.addColumn(
|
||
|
|
'data_queries',
|
||
|
|
new TableColumn({
|
||
|
|
name: 'app_version_id',
|
||
|
|
type: 'uuid',
|
||
|
|
isNullable: true,
|
||
|
|
})
|
||
|
|
);
|
||
|
|
|
||
|
|
await queryRunner.createForeignKey(
|
||
|
|
'data_queries',
|
||
|
|
new TableForeignKey({
|
||
|
|
columnNames: ['app_version_id'],
|
||
|
|
referencedColumnNames: ['id'],
|
||
|
|
referencedTableName: 'app_versions',
|
||
|
|
onDelete: 'CASCADE',
|
||
|
|
})
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
public async down(queryRunner: QueryRunner): Promise<void> {}
|
||
|
|
}
|