import { MigrationInterface, QueryRunner } from "typeorm";

export class Migrations1738588392190 implements MigrationInterface {
    name = 'Migrations1738588392190'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`CREATE TABLE "reject_completion_request" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "reason" text, "created_at" TIMESTAMP(0) NOT NULL DEFAULT now(), "updated_at" TIMESTAMP(0) NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP(0), "campaign_influencer_id" uuid, CONSTRAINT "PK_2f112d387e15f54f261a4c8da97" PRIMARY KEY ("id"))`);
        await queryRunner.query(`ALTER TABLE "reject_completion_request" ADD CONSTRAINT "FK_0f842e91008bc5bd5a6963432a1" FOREIGN KEY ("campaign_influencer_id") REFERENCES "campaign_influencers"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "reject_completion_request" DROP CONSTRAINT "FK_0f842e91008bc5bd5a6963432a1"`);
        await queryRunner.query(`DROP TABLE "reject_completion_request"`);
    }

}
