import { MigrationInterface, QueryRunner } from "typeorm";

export class Migrations1735216568141 implements MigrationInterface {
    name = 'Migrations1735216568141'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "likes_count"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "likes_count" bigint NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "video_count"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "video_count" bigint NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "following_count"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "following_count" bigint NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "follower_count"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "follower_count" bigint NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "engagement_count"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "engagement_count" bigint NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "total_views"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "total_views" bigint NOT NULL DEFAULT '0'`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "total_views"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "total_views" integer NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "engagement_count"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "engagement_count" integer NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "follower_count"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "follower_count" integer NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "following_count"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "following_count" integer NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "video_count"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "video_count" integer NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "likes_count"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "likes_count" integer NOT NULL DEFAULT '0'`);
    }

}
