import { MigrationInterface, QueryRunner } from 'typeorm';

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

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      ALTER TABLE freight.booking_approval_step
        ADD COLUMN IF NOT EXISTS blocks_role VARCHAR(30) NULL;
    `);
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`
      ALTER TABLE freight.booking_approval_step
        DROP COLUMN IF EXISTS blocks_role;
    `);
  }
}
