import { MigrationInterface, QueryRunner } from 'typeorm';

export class VipCategory1718070608814 implements MigrationInterface {
  name = 'VipCategory1718070608814';

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `CREATE TYPE "public"."vip_categories_status_enum" AS ENUM('active', 'cancel', 'confirmed', 'draft', 'expired', 'inactive', 'pending', 'refunded', 'rejected', 'settled', 'waiting')`,
    );
    await queryRunner.query(
      `CREATE TABLE "vip_categories" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "creator_id" character varying(36), "creator_name" character varying(125), "editor_id" character varying(36), "editor_name" character varying(125), "created_at" bigint NOT NULL, "updated_at" bigint NOT NULL, "status" "public"."vip_categories_status_enum" NOT NULL DEFAULT 'draft', "name" character varying NOT NULL, CONSTRAINT "PK_b4873a565ca593e90eff71a99a3" PRIMARY KEY ("id"))`,
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`DROP TABLE "vip_categories"`);
    await queryRunner.query(`DROP TYPE "public"."vip_categories_status_enum"`);
  }
}
