import { MigrationInterface, QueryRunner } from 'typeorm'; export class GenerateMissingMigrations1661303052901 implements MigrationInterface { name = 'GenerateMissingMigrations1661303052901'; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE "retailer_products" DROP CONSTRAINT "FK_87839253e3642f882e0f2225f7a" `); await queryRunner.query(` ALTER TABLE "retailer_products" ALTER COLUMN "aggregateProductId" DROP NOT NULL `); await queryRunner.query(` ALTER TABLE "retailer_products" ADD CONSTRAINT "FK_87839253e3642f882e0f2225f7a" FOREIGN KEY ("aggregateProductId") REFERENCES "aggregate_products"("id") ON DELETE NO ACTION ON UPDATE NO ACTION `); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE "retailer_products" DROP CONSTRAINT "FK_87839253e3642f882e0f2225f7a" `); await queryRunner.query(` ALTER TABLE "retailer_products" ALTER COLUMN "aggregateProductId" SET NOT NULL `); await queryRunner.query(` ALTER TABLE "retailer_products" ADD CONSTRAINT "FK_87839253e3642f882e0f2225f7a" FOREIGN KEY ("aggregateProductId") REFERENCES "aggregate_products"("id") ON DELETE NO ACTION ON UPDATE NO ACTION `); } }