import { MigrationInterface, QueryRunner } from "typeorm"

export class AddEntityForMeetAndGrretPricing1755683851665 implements MigrationInterface {
  name = "AddEntityForMeetAndGrretPricing1755683851665"

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `CREATE TABLE "meet_and_greet_pricing" ("id" SERIAL NOT NULL, "service_type_id" integer, "price" character varying, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "updated_at" TIMESTAMP NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP, CONSTRAINT "PK_8d8884ac4a9247d2b44e5cfb704" PRIMARY KEY ("id"))`,
    )
    await queryRunner.query(
      `ALTER TABLE "meet_and_greet_pricing" ADD CONSTRAINT "FK_648f1c17e68ccea3c8996ef91a5" FOREIGN KEY ("service_type_id") REFERENCES "trip_types"("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_648f1c17e68ccea3c8996ef91a5"`,
    )
    await queryRunner.query(`DROP TABLE "meet_and_greet_pricing"`)
  }
}
