-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aplicar o interest X discomfortZone no relearn [clzaefmpe000qx40lk6ct…
…a88s]
- Loading branch information
1 parent
f038fea
commit 39b806e
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
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
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,28 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
|
||
export class Migration1722899892198 implements MigrationInterface { | ||
name = 'Migration1722899892198' | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "question" DROP CONSTRAINT "FK_960e423bd8c1f0d9913bc1c099e"`); | ||
await queryRunner.query(`ALTER TABLE "question" DROP CONSTRAINT "FK_5b87d9d19127bd5d92026017a7b"`); | ||
await queryRunner.query(`ALTER TABLE "skill" ADD "discomfortZone" double precision`); | ||
await queryRunner.query(`CREATE SEQUENCE IF NOT EXISTS "question_id_seq" OWNED BY "question"."id"`); | ||
await queryRunner.query(`ALTER TABLE "question" ALTER COLUMN "id" SET DEFAULT nextval('"question_id_seq"')`); | ||
await queryRunner.query(`ALTER TABLE "question" ALTER COLUMN "id" DROP DEFAULT`); | ||
await queryRunner.query(`ALTER TABLE "question" ADD CONSTRAINT "FK_80f29cc01d0bd1644e389cc13be" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); | ||
await queryRunner.query(`ALTER TABLE "question" ADD CONSTRAINT "FK_70f9da8788aa253b76bb919c872" FOREIGN KEY ("docId") REFERENCES "doc"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "question" DROP CONSTRAINT "FK_70f9da8788aa253b76bb919c872"`); | ||
await queryRunner.query(`ALTER TABLE "question" DROP CONSTRAINT "FK_80f29cc01d0bd1644e389cc13be"`); | ||
await queryRunner.query(`ALTER TABLE "question" ALTER COLUMN "id" SET DEFAULT nextval('note_id_seq')`); | ||
await queryRunner.query(`ALTER TABLE "question" ALTER COLUMN "id" DROP DEFAULT`); | ||
await queryRunner.query(`DROP SEQUENCE "question_id_seq"`); | ||
await queryRunner.query(`ALTER TABLE "skill" DROP COLUMN "discomfortZone"`); | ||
await queryRunner.query(`ALTER TABLE "question" ADD CONSTRAINT "FK_5b87d9d19127bd5d92026017a7b" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); | ||
await queryRunner.query(`ALTER TABLE "question" ADD CONSTRAINT "FK_960e423bd8c1f0d9913bc1c099e" FOREIGN KEY ("docId") REFERENCES "doc"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); | ||
} | ||
|
||
} |