import { MigrationInterface, QueryRunner } from "typeorm"

export class AddEntityForMeetAndGrretPricing1755684461646 implements MigrationInterface {
  name = "AddEntityForMeetAndGrretPricing1755684461646"

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "meet_and_greet_pricing" ADD "plan_id" integer NOT NULL`,
    )
    await queryRunner.query(
      `ALTER TABLE "meet_and_greet_pricing" ADD CONSTRAINT "FK_0acb66d57321efa1c0f42607fcc" FOREIGN KEY ("plan_id") REFERENCES "pricing_plans"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`,
    )
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "meet_and_greet_pricing" DROP CONSTRAINT "FK_0acb66d57321efa1c0f42607fcc"`,
    )
    await queryRunner.query(
      `ALTER TABLE "meet_and_greet_pricing" DROP COLUMN "plan_id"`,
    )
  }
}
