mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-27 06:18:06 +09:00
[backend] Add a new index to the note table for faster generation of following query heuristics
This commit is contained in:
parent
bd63e16e5f
commit
384fb76a26
@ -0,0 +1,13 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class AddNoteCreatedatUseridIdx1702680809638 implements MigrationInterface {
|
||||
name = 'AddNoteCreatedatUseridIdx1702680809638'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_note_createdAt_userId" ON "note" ("createdAt", "userId")`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`DROP INDEX IF EXISTS "public"."IDX_note_createdAt_userId"`);
|
||||
}
|
||||
}
|
@ -18,6 +18,7 @@ import { Channel } from "./channel.js";
|
||||
@Index("IDX_NOTE_VISIBLE_USER_IDS", { synchronize: false })
|
||||
@Index("IDX_note_userId_id", ["userId", "id"])
|
||||
@Index("IDX_note_id_userHost", ["id", "userHost"])
|
||||
@Index("IDX_note_createdAt_userId", ["createdAt", "userId"])
|
||||
export class Note {
|
||||
@PrimaryColumn(id())
|
||||
public id: string;
|
||||
|
Loading…
Reference in New Issue
Block a user