import { MigrationInterface, QueryRunner } from "typeorm";

export class Migrations1739776947128 implements MigrationInterface {
    name = 'Migrations1739776947128'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "youtube_channels" ADD "url" text NOT NULL DEFAULT ''`);
        await queryRunner.query(`ALTER TABLE "facebook_pages" ADD "url" text NOT NULL DEFAULT ''`);
        await queryRunner.query(`ALTER TABLE "instagram_profiles" ADD "url" text NOT NULL DEFAULT ''`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" ADD "url" text NOT NULL DEFAULT ''`);
        await queryRunner.query(`ALTER TABLE "xiaohongshu_profiles" ADD "engagement_count_like" bigint NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "xiaohongshu_profiles" ADD "engagement_count_bookmark" bigint NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE "xiaohongshu_profiles" ADD "url" text NOT NULL DEFAULT ''`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "xiaohongshu_profiles" DROP COLUMN "url"`);
        await queryRunner.query(`ALTER TABLE "xiaohongshu_profiles" DROP COLUMN "engagement_count_bookmark"`);
        await queryRunner.query(`ALTER TABLE "xiaohongshu_profiles" DROP COLUMN "engagement_count_like"`);
        await queryRunner.query(`ALTER TABLE "tiktok_profiles" DROP COLUMN "url"`);
        await queryRunner.query(`ALTER TABLE "instagram_profiles" DROP COLUMN "url"`);
        await queryRunner.query(`ALTER TABLE "facebook_pages" DROP COLUMN "url"`);
        await queryRunner.query(`ALTER TABLE "youtube_channels" DROP COLUMN "url"`);
    }

}
