-
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.
não estou conseguindo salvar anotações [clziuwya40000w90le2yly71t]
- Loading branch information
1 parent
39b806e
commit 81dc482
Showing
1 changed file
with
10 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,15 @@ | ||
import { MigrationInterface, QueryRunner } from "typeorm"; | ||
import { MigrationInterface, QueryRunner } from "typeorm" | ||
|
||
export class Migration1722899892198 implements MigrationInterface { | ||
name = 'Migration1722899892198' | ||
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`); | ||
} | ||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`ALTER TABLE "skill" ADD "discomfortZone" double precision` | ||
) | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`ALTER TABLE "skill" DROP COLUMN "discomfortZone"`) | ||
} | ||
} |