Replace notes(userId) index with (userId, id) #28

Merged
sugar merged 4 commits from sugar/forkey:replace-notes-user-id-index-with-user-id-id into main 2025-02-23 13:05:55 +00:00
2 changed files with 12 additions and 0 deletions
Showing only changes of commit 93dba136ab - Show all commits

View file

@ -0,0 +1,11 @@
export class NoteUserIdIdIndex1736888704471 {
name = 'NoteUserIdIdIndex1736888704471'
async up(queryRunner) {
await queryRunner.query(`CREATE INDEX "IDX_note_userId_id" ON "note" ("userId", "id") `);
}
async down(queryRunner) {
await queryRunner.query(`DROP INDEX "public"."IDX_note_userId_id"`);
}
}

View file

@ -15,6 +15,7 @@ import type { MiDriveFile } from './DriveFile.js';
@Index('IDX_NOTE_MENTIONS', { synchronize: false })
@Index('IDX_NOTE_FILE_IDS', { synchronize: false })
@Index('IDX_NOTE_VISIBLE_USER_IDS', { synchronize: false })
@Index('IDX_note_userId_id', ['userId', 'id'])
export class MiNote {
@PrimaryColumn(id())
public id: string;