mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-11-27 14:28:08 +09:00
[backend] Add a new index to the user table for faster notifications queries
This should drastically improve performance of the i/notification endpoint
This commit is contained in:
parent
384fb76a26
commit
52b0c6c8f8
@ -0,0 +1,13 @@
|
|||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UserIssuspendedIdx1702744857694 implements MigrationInterface {
|
||||||
|
name = 'UserIssuspendedIdx1702744857694'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_8977c6037a7bc2cb0c84b6d4db" ON "user" ("isSuspended")`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`DROP INDEX IF EXISTS "public"."IDX_8977c6037a7bc2cb0c84b6d4db"`);
|
||||||
|
}
|
||||||
|
}
|
@ -158,6 +158,7 @@ export class User {
|
|||||||
})
|
})
|
||||||
public tags: string[];
|
public tags: string[];
|
||||||
|
|
||||||
|
@Index()
|
||||||
@Column("boolean", {
|
@Column("boolean", {
|
||||||
default: false,
|
default: false,
|
||||||
comment: "Whether the User is suspended.",
|
comment: "Whether the User is suspended.",
|
||||||
|
Loading…
Reference in New Issue
Block a user