diff --git a/packages/backend/src/migration/1702744857694-user-issuspended-idx.ts b/packages/backend/src/migration/1702744857694-user-issuspended-idx.ts new file mode 100644 index 000000000..86616e855 --- /dev/null +++ b/packages/backend/src/migration/1702744857694-user-issuspended-idx.ts @@ -0,0 +1,13 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UserIssuspendedIdx1702744857694 implements MigrationInterface { + name = 'UserIssuspendedIdx1702744857694' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_8977c6037a7bc2cb0c84b6d4db" ON "user" ("isSuspended")`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`DROP INDEX IF EXISTS "public"."IDX_8977c6037a7bc2cb0c84b6d4db"`); + } +} diff --git a/packages/backend/src/models/entities/user.ts b/packages/backend/src/models/entities/user.ts index d7412500e..92de37e3f 100644 --- a/packages/backend/src/models/entities/user.ts +++ b/packages/backend/src/models/entities/user.ts @@ -158,6 +158,7 @@ export class User { }) public tags: string[]; + @Index() @Column("boolean", { default: false, comment: "Whether the User is suspended.",