3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 12:25:02 +00:00

Add !deletecase

This commit is contained in:
Dragory 2020-08-09 22:44:07 +03:00
parent 8826b2521d
commit ddbbc543c2
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
9 changed files with 146 additions and 6 deletions

View file

@ -0,0 +1,22 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { TableForeignKey } from "typeorm/index";
export class AddCaseNotesForeignKey1596994103885 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.createForeignKey(
"case_notes",
new TableForeignKey({
name: "case_notes_case_id_fk",
columnNames: ["case_id"],
referencedTableName: "cases",
referencedColumnNames: ["id"],
onDelete: "CASCADE",
onUpdate: "CASCADE",
}),
);
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.dropForeignKey("case_notes", "case_notes_case_id_fk");
}
}