import { MigrationInterface, QueryRunner } from "typeorm"

export class AlterFleetManagementEntity1760696950022 implements MigrationInterface {
  name = "AlterFleetManagementEntity1760696950022"

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "fleet_operations" ALTER COLUMN "odo_reader" DROP NOT NULL`,
    )
    await queryRunner.query(
      `ALTER TABLE "fleet_operations" ALTER COLUMN "unit" DROP NOT NULL`,
    )
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "fleet_operations" ALTER COLUMN "unit" SET NOT NULL`,
    )
    await queryRunner.query(
      `ALTER TABLE "fleet_operations" ALTER COLUMN "odo_reader" SET NOT NULL`,
    )
  }
}
