3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 04:25:01 +00:00
zeppelin/backend/src/migrations/1596994103885-AddCaseNotesForeignKey.ts
rubyowo 914efb6fcc
chore: format repo (#482)
Begone formatting errors
2024-06-02 16:21:27 +01:00

21 lines
681 B
TypeScript

import { MigrationInterface, QueryRunner, TableForeignKey } from "typeorm";
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");
}
}