mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
add threadId to IDX_note_for_timelines
This commit is contained in:
parent
dc35731589
commit
9dc74f6f33
1 changed files with 28 additions and 0 deletions
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
export class FixIDXNoteForTimeline1749097536193 {
|
||||||
|
async up(queryRunner) {
|
||||||
|
await queryRunner.query('drop index "IDX_note_for_timelines"');
|
||||||
|
await queryRunner.query(`
|
||||||
|
create index "IDX_note_for_timelines"
|
||||||
|
on "note" ("id" desc, "channelId", "visibility", "userHost")
|
||||||
|
include ("userId", "replyId", "replyUserId", "replyUserHost", "renoteId", "renoteUserId", "renoteUserHost", "threadId")
|
||||||
|
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"');
|
||||||
|
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'`);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue