export class GroupEmojisAndCalls1783150000000 {
    name = "GroupEmojisAndCalls1783150000000";
    async up(queryRunner) {
        await queryRunner.query(`ALTER TABLE "user_emoji" ALTER COLUMN "userId" DROP NOT NULL`);
        await queryRunner.query(`ALTER TABLE "user_emoji" ADD "userGroupId" character varying(32)`);
        await queryRunner.query(`CREATE INDEX "IDX_user_emoji_userGroupId" ON "user_emoji" ("userGroupId")`);
        await queryRunner.query(`CREATE UNIQUE INDEX "IDX_user_emoji_name_userGroupId" ON "user_emoji" ("name", "userGroupId") WHERE "userGroupId" IS NOT NULL`);
    }
    async down(queryRunner) {
        await queryRunner.query(`DROP INDEX "public"."IDX_user_emoji_name_userGroupId"`);
        await queryRunner.query(`DROP INDEX "public"."IDX_user_emoji_userGroupId"`);
        await queryRunner.query(`ALTER TABLE "user_emoji" DROP COLUMN "userGroupId"`);
        await queryRunner.query(`ALTER TABLE "user_emoji" ALTER COLUMN "userId" SET NOT NULL`);
    }
}
