import { Migration } from '@mikro-orm/migrations';

export class Migration20260226063544 extends Migration {

  override async up(): Promise<void> {
    this.addSql(`alter table "deliveries" alter column "delivery_fee" type int using ("delivery_fee"::int);`);
    this.addSql(`alter table "deliveries" alter column "per_kilometer_fee" type int using ("per_kilometer_fee"::int);`);
    this.addSql(`alter table "deliveries" alter column "distance_based_min_cost" type int using ("distance_based_min_cost"::int);`);
    this.addSql(`alter table "deliveries" alter column "min_order_price" type int using ("min_order_price"::int);`);
  }

  override async down(): Promise<void> {
    this.addSql(`alter table "deliveries" alter column "delivery_fee" type numeric(10,0) using ("delivery_fee"::numeric(10,0));`);
    this.addSql(`alter table "deliveries" alter column "per_kilometer_fee" type numeric(10,0) using ("per_kilometer_fee"::numeric(10,0));`);
    this.addSql(`alter table "deliveries" alter column "distance_based_min_cost" type numeric(10,0) using ("distance_based_min_cost"::numeric(10,0));`);
    this.addSql(`alter table "deliveries" alter column "min_order_price" type numeric(10,0) using ("min_order_price"::numeric(10,0));`);
  }

}
