import { MigrationInterface, QueryRunner } from 'typeorm';

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

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "transaction_taxes" ADD "tax_total_value" numeric`,
    );
    await queryRunner.query(
      `ALTER TABLE "transaction_taxes" DROP COLUMN "taxt_value"`,
    );
    await queryRunner.query(
      `ALTER TABLE "transaction_taxes" ADD "taxt_value" numeric`,
    );
  }

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "transaction_taxes" DROP COLUMN "taxt_value"`,
    );
    await queryRunner.query(
      `ALTER TABLE "transaction_taxes" ADD "taxt_value" character varying`,
    );
    await queryRunner.query(
      `ALTER TABLE "transaction_taxes" DROP COLUMN "tax_total_value"`,
    );
  }
}
