import { MigrationInterface, QueryRunner } from 'typeorm';

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

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

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