-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migration file for stratification factor status
- Loading branch information
1 parent
c588ba0
commit 4b6346b
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
backend/packages/Upgrade/src/database/migrations/1695975122095-stratificationFactorStatus.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {MigrationInterface, QueryRunner} from "typeorm"; | ||
|
||
export class stratificationFactorStatus1695975122095 implements MigrationInterface { | ||
name = 'stratificationFactorStatus1695975122095' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "public"."user_stratification_factor" DROP CONSTRAINT "FK_a314482a152dd63f49898feb468"`); | ||
await queryRunner.query(`ALTER TABLE "public"."experiment" ADD CONSTRAINT "FK_9ac712ea8ff6ffe88dd02417aa9" FOREIGN KEY ("stratificationFactorId") REFERENCES "stratification_factor"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); | ||
await queryRunner.query(`ALTER TABLE "public"."user_stratification_factor" ADD CONSTRAINT "FK_a314482a152dd63f49898feb468" FOREIGN KEY ("userId") REFERENCES "experiment_user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "public"."user_stratification_factor" DROP CONSTRAINT "FK_a314482a152dd63f49898feb468"`); | ||
await queryRunner.query(`ALTER TABLE "public"."experiment" ADD CONSTRAINT "FK_9ac712ea8ff6ffe88dd02417aa9" FOREIGN KEY ("stratificationFactorId") REFERENCES "stratification_factor"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); | ||
await queryRunner.query(`ALTER TABLE "public"."user_stratification_factor" ADD CONSTRAINT "FK_a314482a152dd63f49898feb468" FOREIGN KEY ("userId") REFERENCES "experiment_user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); | ||
} | ||
|
||
} |