feat: add missing migration file

This commit is contained in:
Dragory 2021-10-17 11:56:00 +03:00
parent 8b486e280c
commit 05bd84b1f9
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1

View file

@ -0,0 +1,32 @@
import { MigrationInterface, QueryRunner, TableForeignKey } from "typeorm";
export class RemoveTagResponsesForeignKeys1634459708599 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropForeignKey("tag_responses", "FK_5f5cf713420286acfa714b98312");
await queryRunner.dropForeignKey("tag_responses", "FK_a0da4586031d332a6bc298925e3");
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createForeignKey(
"tag_responses",
new TableForeignKey({
name: "FK_5f5cf713420286acfa714b98312",
columnNames: ["command_message_id"],
referencedTableName: "messages",
referencedColumnNames: ["id"],
onDelete: "CASCADE",
}),
);
await queryRunner.createForeignKey(
"tag_responses",
new TableForeignKey({
name: "FK_a0da4586031d332a6bc298925e3",
columnNames: ["response_message_id"],
referencedTableName: "messages",
referencedColumnNames: ["id"],
onDelete: "CASCADE",
}),
);
}
}