fix: reflect revert to downgrade.sql
This commit is contained in:
parent
f7a8a58cb2
commit
af800833b4
1 changed files with 0 additions and 14 deletions
|
@ -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";
|
||||
|
||||
|
|
Loading…
Reference in a new issue