3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-16 22:55:03 +00:00
zeppelin/backend/src/migrations/1596994103885-AddCaseNotesForeignKey.ts
Ruby 339edd5faa
chore: format repo
Begone formatting errors
2024-06-02 17:15:29 +02: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");
}
}