import { MigrationInterface, QueryRunner } from 'typeorm';

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

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `CREATE TYPE "public"."report_bookmark_type_enum" AS ENUM('TABLE_CONFIG', 'FILTER_TABLE')`,
    );
    await queryRunner.query(
      `ALTER TABLE "report_bookmark" ADD "type" "public"."report_bookmark_type_enum" NOT NULL DEFAULT 'TABLE_CONFIG'`,
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`ALTER TABLE "report_bookmark" DROP COLUMN "type"`);
    await queryRunner.query(`DROP TYPE "public"."report_bookmark_type_enum"`);
  }
}
