import { MigrationInterface, QueryRunner } from 'typeorm';

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

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `CREATE TYPE "public"."season_types_status_enum" AS ENUM('active', 'cancel', 'confirmed', 'draft', 'expired', 'inactive', 'pending', 'refunded', 'rejected', 'settled', 'waiting')`,
    );
    await queryRunner.query(
      `CREATE TABLE "season_types" ("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"."season_types_status_enum" NOT NULL DEFAULT 'draft', "name" character varying NOT NULL, CONSTRAINT "PK_6b441ce8351cb93b9efb636f87e" PRIMARY KEY ("id"))`,
    );
  }

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