add systemid column and constraint to member.ts entity as well as migration

This commit is contained in:
2026-04-17 10:39:13 -04:00
parent ee4dca2ae3
commit ae04e91dbd
3 changed files with 33 additions and 2 deletions

View File

@@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class Update1773756156389 implements MigrationInterface {
name = 'Update1773756156389'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "Member" ADD "systemid" integer`);
await queryRunner.query(`ALTER TABLE "Member" ADD CONSTRAINT "FK_Member_System" FOREIGN KEY ("systemid") REFERENCES "System"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "Member" DROP CONSTRAINT "FK_Member_System"`);
await queryRunner.query(`ALTER TABLE "Member" DROP COLUMN "systemid"`);
}
}