import { MigrationInterface, QueryRunner } from 'typeorm';

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

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`ALTER TABLE "taxes" DROP COLUMN "value"`);
    await queryRunner.query(
      `ALTER TABLE "taxes" ADD "value" double precision NOT NULL DEFAULT '0'`,
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`ALTER TABLE "taxes" DROP COLUMN "value"`);
    await queryRunner.query(
      `ALTER TABLE "taxes" ADD "value" integer NOT NULL DEFAULT '0'`,
    );
  }
}
