Conditions | 1 |
Total Lines | 7 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import {MigrationInterface, QueryRunner} from "typeorm"; |
||
5 | |||
6 | public async up(queryRunner: QueryRunner): Promise<void> { |
||
7 | await queryRunner.query(`ALTER TABLE "photo" DROP CONSTRAINT "FK_e4a158e221f64fd303021454b51"`); |
||
8 | await queryRunner.query(`ALTER TABLE "photo" RENAME COLUMN "shootingId" TO "classroomId"`); |
||
9 | await queryRunner.query(`CREATE TABLE "classroom" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "name" character varying NOT NULL, "shootingId" uuid NOT NULL, CONSTRAINT "PK_729f896c8b7b96ddf10c341e6ff" PRIMARY KEY ("id"))`); |
||
10 | await queryRunner.query(`ALTER TABLE "classroom" ADD CONSTRAINT "FK_43477ae183519f09a40c2fd1250" FOREIGN KEY ("shootingId") REFERENCES "shooting"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); |
||
11 | await queryRunner.query(`ALTER TABLE "photo" ADD CONSTRAINT "FK_b30092abccf18923f482de41f38" FOREIGN KEY ("classroomId") REFERENCES "classroom"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); |
||
12 | } |
||
23 |