import { MigrationInterface, QueryRunner } from 'typeorm'; export class AddRetailerProductVariantUpdateHistory1669415750773 implements MigrationInterface { name = 'AddRetailerProductVariantUpdateHistory1669415750773'; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query(` CREATE TABLE "retailer_product_variant_update_history" ( "id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "price" double precision, "retailProductVariantId" uuid NOT NULL, CONSTRAINT "PK_9b8902d5981b66805b798518630" PRIMARY KEY ("id") ) `); await queryRunner.query(` ALTER TABLE "retailer_product_variant_update_history" ADD CONSTRAINT "FK_2432cbf2c1941a6cd4480cee3ca" FOREIGN KEY ("retailProductVariantId") REFERENCES "retailer_product_variants"("id") ON DELETE NO ACTION ON UPDATE NO ACTION `); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(` ALTER TABLE "retailer_product_variant_update_history" DROP CONSTRAINT "FK_2432cbf2c1941a6cd4480cee3ca" `); await queryRunner.query(` DROP TABLE "retailer_product_variant_update_history" `); } }