From af800833b4218eccf88e6c0e8ae3b73efa6aefe0 Mon Sep 17 00:00:00 2001
From: naskya <m@naskya.net>
Date: Mon, 18 Mar 2024 03:47:57 +0900
Subject: [PATCH] fix: reflect revert to downgrade.sql

---
 docs/downgrade.sql | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/docs/downgrade.sql b/docs/downgrade.sql
index a96d8c49db..1d26a6fa3b 100644
--- a/docs/downgrade.sql
+++ b/docs/downgrade.sql
@@ -2,7 +2,6 @@ BEGIN;
 
 DELETE FROM "migrations" WHERE name IN (
     'FixMutingIndices1710690239308',
-    'RemoveMentionedUsersColumn1710688552234',
     'NoteFile1710304584214',
     'RenameMetaColumns1705944717480',
     'SeparateHardMuteWordsAndPatterns1706413792769',
@@ -30,19 +29,6 @@ CREATE INDEX "IDX_renote_muting_createdAt" ON "muting" ("createdAt");
 CREATE INDEX "IDX_renote_muting_muteeId" ON "muting" ("muteeId");
 CREATE INDEX "IDX_renote_muting_muterId" ON "muting" ("muterId");
 
--- remove-mentioned-users-column
-ALTER TABLE "note" ADD "mentionedRemoteUsers" text NOT NULL DEFAULT '[]'::text;
-CREATE TABLE "temp_mentions_1710688552234" AS
-  SELECT "id", "url", "uri", "username", "host"
-  FROM "user"
-  JOIN "user_profile" ON "user"."id" = "user_profile". "userId" WHERE "user"."host" IS NOT NULL;
-CREATE UNIQUE INDEX "temp_mentions_id" ON "temp_mentions_1710688552234" ("id");
-UPDATE "note" SET "mentionedRemoteUsers" = (
-  SELECT COALESCE(json_agg(row_to_json("data")::jsonb - 'id')::text, '[]') FROM "temp_mentions_1710688552234" AS "data"
-  WHERE "data"."id" = ANY("note"."mentions")
-);
-DROP TABLE "temp_mentions_1710688552234";
-
 -- note-file
 DROP TABLE "note_file";