From dabe38a991ebd7271d541ac84fa3d55fc503fa7c Mon Sep 17 00:00:00 2001
From: Daiki Mizukami <tesaguriguma@gmail.com>
Date: Fri, 9 Aug 2024 22:10:50 +0900
Subject: [PATCH] fix: set `publicReactions` of remote users to false

---
 ...08290742-remote-public-reactions-set-false.js | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 packages/backend/migration/1723208290742-remote-public-reactions-set-false.js

diff --git a/packages/backend/migration/1723208290742-remote-public-reactions-set-false.js b/packages/backend/migration/1723208290742-remote-public-reactions-set-false.js
new file mode 100644
index 0000000000..de8e42cff4
--- /dev/null
+++ b/packages/backend/migration/1723208290742-remote-public-reactions-set-false.js
@@ -0,0 +1,16 @@
+/*
+ * SPDX-FileCopyrightText: syuilo and misskey-project
+ * SPDX-License-Identifier: AGPL-3.0-only
+ */
+
+export class RemotePublicReactionsSetFalse1723208290742 {
+    name = 'RemotePublicReactionsSetFalse1723208290742'
+
+    public async up(queryRunner) {
+        await queryRunner.query(`UPDATE "user_profile" SET "publicReactions" = FALSE FROM "users" WHERE "user_profile"."userId" = "user"."id" AND "user"."host" IS NULL`);
+    }
+
+    public async down(queryRunner) {
+        // no valid down migration
+    }
+}