iceshrimp/packages/backend/src/migration/1700623165718-add-note-userhost-id-idx.ts
Laura Hausmann 6e82e18eea
[backend] Add multi column index for userHost to note table
This drastically improves local and social timeline performance
2023-11-22 04:39:37 +01:00

14 lines
511 B
TypeScript

import { MigrationInterface, QueryRunner } from "typeorm";
export class AddNoteIdUserhostIdx1700623165718 implements MigrationInterface {
name = 'AddNoteIdUserhostIdx1700623165718'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE INDEX "IDX_note_id_userHost" ON "note" ("id", "userHost") `);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "public"."IDX_note_id_userHost"`);
}
}