mirror of
https://git.boykissers.com/pawkey/pawkey-sk.git
synced 2025-12-20 04:04:16 +00:00
replace index on note.userHost
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
/*
|
||||||
|
* SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
|
||||||
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
*/
|
||||||
|
|
||||||
|
export class ReplaceNoteUserHostIndex1748990452958 {
|
||||||
|
name = 'ReplaceNoteUserHostIndex1748990452958'
|
||||||
|
|
||||||
|
async up(queryRunner) {
|
||||||
|
await queryRunner.query(`DROP INDEX "public"."IDX_7125a826ab192eb27e11d358a5"`);
|
||||||
|
await queryRunner.query(`
|
||||||
|
create index "IDX_note_userHost_id"
|
||||||
|
on "note" ("userHost", "id" desc)
|
||||||
|
nulls not distinct`);
|
||||||
|
await queryRunner.query(`comment on index "IDX_note_userHost_id" is 'User host with ID included'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
async down(queryRunner) {
|
||||||
|
await queryRunner.query(`drop index if exists "IDX_note_userHost_id"`);
|
||||||
|
await queryRunner.query(`CREATE INDEX "IDX_7125a826ab192eb27e11d358a5" ON "note" ("userHost") `);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -12,6 +12,7 @@ import { MiChannel } from './Channel.js';
|
|||||||
import type { MiDriveFile } from './DriveFile.js';
|
import type { MiDriveFile } from './DriveFile.js';
|
||||||
|
|
||||||
@Index('IDX_724b311e6f883751f261ebe378', ['userId', 'id'])
|
@Index('IDX_724b311e6f883751f261ebe378', ['userId', 'id'])
|
||||||
|
@Index('IDX_note_userHost_id', { synchronize: false }) // (userHost, id desc)
|
||||||
@Entity('note')
|
@Entity('note')
|
||||||
export class MiNote {
|
export class MiNote {
|
||||||
@PrimaryColumn(id())
|
@PrimaryColumn(id())
|
||||||
@@ -216,7 +217,6 @@ export class MiNote {
|
|||||||
public processErrors: string[] | null;
|
public processErrors: string[] | null;
|
||||||
|
|
||||||
//#region Denormalized fields
|
//#region Denormalized fields
|
||||||
@Index()
|
|
||||||
@Column('varchar', {
|
@Column('varchar', {
|
||||||
length: 128, nullable: true,
|
length: 128, nullable: true,
|
||||||
comment: '[Denormalized]',
|
comment: '[Denormalized]',
|
||||||
|
|||||||
Reference in New Issue
Block a user