mirror of
https://github.com/ToolJet/ToolJet
synced 2026-04-21 21:47:17 +00:00
* Fix for app delete issue * fix * fix * added dbTransactionWrap for more functions * reuse dbTransactionWrap * onboarding changes * SSO fix * fix * added test cases * changed threads comments relation * added test cases
21 lines
780 B
TypeScript
21 lines
780 B
TypeScript
import { MigrationInterface, QueryRunner, TableForeignKey } from 'typeorm';
|
|
|
|
export class addForeignKeyForCommentUsers1664535394458 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
const table = await queryRunner.getTable('comment_users');
|
|
const foreignKey = table.foreignKeys.find((fk) => fk.columnNames.indexOf('comment_id') !== -1);
|
|
await queryRunner.dropForeignKey('comment_users', foreignKey);
|
|
|
|
await queryRunner.createForeignKey(
|
|
'comment_users',
|
|
new TableForeignKey({
|
|
columnNames: ['comment_id'],
|
|
referencedColumnNames: ['id'],
|
|
referencedTableName: 'comments',
|
|
onDelete: 'CASCADE',
|
|
})
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {}
|
|
}
|