From e52ae61590dbe222eb75a3987f40de92452dbfde Mon Sep 17 00:00:00 2001 From: Lauren Liberda Date: Sat, 24 Jul 2021 16:34:39 +0200 Subject: [PATCH] fix migration --- migration/1626475937881-itemIdAssigning.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/migration/1626475937881-itemIdAssigning.ts b/migration/1626475937881-itemIdAssigning.ts index 349a31a..aca9bc9 100644 --- a/migration/1626475937881-itemIdAssigning.ts +++ b/migration/1626475937881-itemIdAssigning.ts @@ -9,11 +9,11 @@ export class itemIdAssigning1626475937881 implements MigrationInterface { await queryRunner.query(`ALTER TABLE "item" ALTER COLUMN "id" DROP DEFAULT`); await queryRunner.query(`ALTER TABLE "item" ADD CONSTRAINT "FK_2e3b654a1f669d356e259e7ca3c" FOREIGN KEY ("parentId") REFERENCES "item"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`); await queryRunner.query(`ALTER TABLE "item_closure_closure" ADD CONSTRAINT "FK_854ec7dacad2df840aa8d4ee0a9" FOREIGN KEY ("id_ancestor") REFERENCES "item"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); - await queryRunner.query(`ALTER TABLE "item_closure_closure" ADD CONSTRAINT "FK_58bff82facc806857035e516c9e" FOREIGN KEY ("id_descendant") REFERENCES "item"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); + //await queryRunner.query(`ALTER TABLE "item_closure_closure" ADD CONSTRAINT "FK_58bff82facc806857035e516c9e" FOREIGN KEY ("id_descendant") REFERENCES "item"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); } public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE "item_closure_closure" DROP CONSTRAINT "FK_58bff82facc806857035e516c9e"`); + //await queryRunner.query(`ALTER TABLE "item_closure_closure" DROP CONSTRAINT "FK_58bff82facc806857035e516c9e"`); await queryRunner.query(`ALTER TABLE "item_closure_closure" DROP CONSTRAINT "FK_854ec7dacad2df840aa8d4ee0a9"`); await queryRunner.query(`ALTER TABLE "item" DROP CONSTRAINT "FK_2e3b654a1f669d356e259e7ca3c"`); await queryRunner.query(`ALTER TABLE "item" ALTER COLUMN "id" SET DEFAULT nextval('items_serial')`);