import { MigrationInterface, QueryRunner } from 'typeorm';

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

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

  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "transactions" DROP COLUMN "discount_percentage"`,
    );
    await queryRunner.query(
      `ALTER TABLE "transactions" ADD "discount_percentage" integer`,
    );
  }
}
