From 4417f0525c9bf525ff31deda525b042ce036c578 Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 7 Jul 2025 09:45:08 +0900 Subject: [PATCH] isRemoteSuspend --- .../migration/1751848750315-RemoteSuspend.js | 26 +++++++++++++++++++ packages/backend/src/models/User.ts | 8 +++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 packages/backend/migration/1751848750315-RemoteSuspend.js diff --git a/packages/backend/migration/1751848750315-RemoteSuspend.js b/packages/backend/migration/1751848750315-RemoteSuspend.js new file mode 100644 index 0000000000..d49e14dc21 --- /dev/null +++ b/packages/backend/migration/1751848750315-RemoteSuspend.js @@ -0,0 +1,26 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + +/** + * @typedef {import('typeorm').MigrationInterface} MigrationInterface + */ + +/** + * @class + * @implements {MigrationInterface} + */ +module.exports = class RemoteSuspend1751848750315 { + name = 'RemoteSuspend1751848750315' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" ADD "isRemoteSuspended" boolean NOT NULL DEFAULT false`); + await queryRunner.query(`COMMENT ON COLUMN "user"."isRemoteSuspended" IS 'Whether the User is suspended by the remote moderators.'`); + } + + async down(queryRunner) { + await queryRunner.query(`COMMENT ON COLUMN "user"."isRemoteSuspended" IS 'Whether the User is suspended by the remote moderators.'`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "isRemoteSuspended"`); + } +} diff --git a/packages/backend/src/models/User.ts b/packages/backend/src/models/User.ts index a6e9edcf5f..33cd01dfe3 100644 --- a/packages/backend/src/models/User.ts +++ b/packages/backend/src/models/User.ts @@ -166,10 +166,16 @@ export class MiUser { @Column('boolean', { default: false, - comment: 'Whether the User is suspended.', + comment: 'Whether the User is suspended by the local moderators.', }) public isSuspended: boolean; + @Column('boolean', { + default: false, + comment: 'Whether the User is suspended by the remote moderators.', + }) + public isRemoteSuspended: boolean; + @Column('boolean', { default: false, comment: 'Whether the User is locked.',