import { MigrationInterface, QueryRunner } from 'typeorm';

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

  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(
      `ALTER TABLE "transaction_items" ADD "qr_image_url" character varying`,
    );
    await queryRunner.query(
      `ALTER TABLE "transactions" ADD "payment_code" character varying`,
    );
  }

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