add index to emoji

This commit is contained in:
samunohito 2024-02-15 13:21:50 +09:00
parent 4bbf0457fa
commit 369d5971d4
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class OptimizeEmojiIndex1707951601000 {
name = 'OptimizeEmojiIndex1707951601000'
async up(queryRunner) {
await queryRunner.query(`CREATE INDEX "IDX_EMOJI_ALIASES_IDS" ON "emoji" using gin ("aliases")`)
await queryRunner.query(`CREATE INDEX "IDX_EMOJI_ROLE_IDS" ON "emoji" using gin ("roleIdsThatCanBeUsedThisEmojiAsReaction")`)
await queryRunner.query(`CREATE INDEX "IDX_EMOJI_CATEGORY" ON "emoji" ("category")`)
}
async down(queryRunner) {
await queryRunner.query(`DROP INDEX "IDX_EMOJI_CATEGORY"`)
await queryRunner.query(`DROP INDEX "IDX_EMOJI_ROLE_IDS"`)
await queryRunner.query(`DROP INDEX "IDX_EMOJI_ALIASES_IDS"`)
}
}