mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-21 19:53:50 +01:00
Add index to improve user/notes endpoint performance
This commit is contained in:
parent
6d648b87d2
commit
2efdbae42e
@ -0,0 +1,10 @@
|
|||||||
|
export class IndexNoteUserId1695861526125 {
|
||||||
|
name = "IndexNoteUserId1695861526125";
|
||||||
|
async up(queryRunner) {
|
||||||
|
await queryRunner.query(`CREATE INDEX "IDX_note_userId_id" ON "note" ("userId", "id")`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async down(queryRunner) {
|
||||||
|
await queryRunner.query(`DROP INDEX "IDX_note_userId_id"`);
|
||||||
|
}
|
||||||
|
}
|
@ -16,6 +16,7 @@ import { Channel } from "./channel.js";
|
|||||||
@Index("IDX_NOTE_TAGS", { synchronize: false })
|
@Index("IDX_NOTE_TAGS", { synchronize: false })
|
||||||
@Index("IDX_NOTE_MENTIONS", { synchronize: false })
|
@Index("IDX_NOTE_MENTIONS", { synchronize: false })
|
||||||
@Index("IDX_NOTE_VISIBLE_USER_IDS", { synchronize: false })
|
@Index("IDX_NOTE_VISIBLE_USER_IDS", { synchronize: false })
|
||||||
|
@Index("IDX_note_userId_id", ["userId", "id"])
|
||||||
export class Note {
|
export class Note {
|
||||||
@PrimaryColumn(id())
|
@PrimaryColumn(id())
|
||||||
public id: string;
|
public id: string;
|
||||||
|
Loading…
Reference in New Issue
Block a user