import { MigrationInterface, QueryRunner } from "typeorm";

export class Migrations1729676117726 implements MigrationInterface {
    name = 'Migrations1729676117726'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`CREATE TYPE "public"."configurations_type_enum" AS ENUM('facebook_followers_count', 'instagram_followers_count', 'tiktok_followers_count', 'youtube_subscriber_count')`);
        await queryRunner.query(`CREATE TABLE "configurations" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "value" text, "type" "public"."configurations_type_enum" NOT NULL DEFAULT 'facebook_followers_count', "name" character varying, "created_at" TIMESTAMP(0) NOT NULL DEFAULT now(), "updated_at" TIMESTAMP(0) NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP(0), CONSTRAINT "PK_ef9fc29709cc5fc66610fc6a664" PRIMARY KEY ("id"))`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`DROP TABLE "configurations"`);
        await queryRunner.query(`DROP TYPE "public"."configurations_type_enum"`);
    }

}
