import { MigrationInterface, QueryRunner } from "typeorm";

export class AddDeletedAtToTrainSchedulingGlobalRules1751000000001
  implements MigrationInterface
{
  name = "AddDeletedAtToTrainSchedulingGlobalRules1751000000001";

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

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