mirror of
https://github.com/pieartsy/PluralFlux.git
synced 2026-04-19 02:35:28 +10:00
add systemid column and constraint to member.ts entity as well as migration
This commit is contained in:
16
database/migrations/1773756156389-update.ts
Normal file
16
database/migrations/1773756156389-update.ts
Normal 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"`);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user