import { MigrationInterface, QueryRunner } from "typeorm";

export class UserBadges1783820000000 implements MigrationInterface {
	name = "UserBadges1783820000000";

	public async up(queryRunner: QueryRunner): Promise<void> {
		await queryRunner.query(`ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "isVerified" boolean NOT NULL DEFAULT false`);
		await queryRunner.query(`ALTER TABLE "user" ADD COLUMN IF NOT EXISTS "minorBadges" character varying(1) array NOT NULL DEFAULT '{}'::varchar[]`);
	}

	public async down(queryRunner: QueryRunner): Promise<void> {
		await queryRunner.query(`ALTER TABLE "user" DROP COLUMN IF EXISTS "minorBadges"`);
		await queryRunner.query(`ALTER TABLE "user" DROP COLUMN IF EXISTS "isVerified"`);
	}
}
