import { MigrationInterface, QueryRunner } from 'typeorm';

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

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

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