import { MigrationInterface, QueryRunner } from "typeorm";

export class Migrations1770361359090 implements MigrationInterface {
    name = 'Migrations1770361359090'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "payment_methods" RENAME COLUMN "status" TO "is_active"`);
        await queryRunner.query(`ALTER TABLE "payment_methods" DROP COLUMN "is_active"`);
        await queryRunner.query(`ALTER TABLE "payment_methods" ADD "is_active" boolean NOT NULL DEFAULT true`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "payment_methods" DROP COLUMN "is_active"`);
        await queryRunner.query(`ALTER TABLE "payment_methods" ADD "is_active" character varying(50) NOT NULL DEFAULT 'active'`);
        await queryRunner.query(`ALTER TABLE "payment_methods" RENAME COLUMN "is_active" TO "status"`);
    }

}
