mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
create IDX_note_for_timelines
This commit is contained in:
parent
8802fbb34d
commit
99e3d45062
2 changed files with 20 additions and 0 deletions
|
@ -0,0 +1,19 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
export class CreateIDXNoteForTimelines1748991828473 {
|
||||
async up(queryRunner) {
|
||||
await queryRunner.query(`
|
||||
create index "IDX_note_for_timelines"
|
||||
on "note" ("id" desc, "channelId", "visibility", "userHost")
|
||||
include ("userId", "userHost", "replyId", "replyUserId", "replyUserHost", "renoteId", "renoteUserId", "renoteUserHost")
|
||||
NULLS NOT DISTINCT`);
|
||||
await queryRunner.query(`comment on index "IDX_note_for_timelines" is 'Covering index for timeline queries'`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
await queryRunner.query(`DROP INDEX "IDX_note_for_timelines"`);
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ import type { MiDriveFile } from './DriveFile.js';
|
|||
|
||||
@Index('IDX_724b311e6f883751f261ebe378', ['userId', 'id'])
|
||||
@Index('IDX_note_userHost_id', { synchronize: false }) // (userHost, id desc)
|
||||
@Index('IDX_note_for_timelines', { synchronize: false }) // (id desc, channelId, visibility, userHost)
|
||||
@Entity('note')
|
||||
export class MiNote {
|
||||
@PrimaryColumn(id())
|
||||
|
|
Loading…
Add table
Reference in a new issue