chore: regenerate entities, update downgrade.sql
This commit is contained in:
parent
3473442875
commit
387bfd5af8
2 changed files with 14 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
BEGIN;
|
BEGIN;
|
||||||
|
|
||||||
DELETE FROM "migrations" WHERE name IN (
|
DELETE FROM "migrations" WHERE name IN (
|
||||||
|
'RemoveMentionedUsersColumn1710688552234',
|
||||||
'NoteFile1710304584214',
|
'NoteFile1710304584214',
|
||||||
'RenameMetaColumns1705944717480',
|
'RenameMetaColumns1705944717480',
|
||||||
'SeparateHardMuteWordsAndPatterns1706413792769',
|
'SeparateHardMuteWordsAndPatterns1706413792769',
|
||||||
|
@ -17,6 +18,19 @@ DELETE FROM "migrations" WHERE name IN (
|
||||||
'RemoveNativeUtilsMigration1705877093218'
|
'RemoveNativeUtilsMigration1705877093218'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
-- 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
|
-- note-file
|
||||||
DROP TABLE "note_file";
|
DROP TABLE "note_file";
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,6 @@ pub struct Model {
|
||||||
#[sea_orm(column_name = "visibleUserIds")]
|
#[sea_orm(column_name = "visibleUserIds")]
|
||||||
pub visible_user_ids: Vec<String>,
|
pub visible_user_ids: Vec<String>,
|
||||||
pub mentions: Vec<String>,
|
pub mentions: Vec<String>,
|
||||||
#[sea_orm(column_name = "mentionedRemoteUsers", column_type = "Text")]
|
|
||||||
pub mentioned_remote_users: String,
|
|
||||||
pub emojis: Vec<String>,
|
pub emojis: Vec<String>,
|
||||||
pub tags: Vec<String>,
|
pub tags: Vec<String>,
|
||||||
#[sea_orm(column_name = "hasPoll")]
|
#[sea_orm(column_name = "hasPoll")]
|
||||||
|
|
Loading…
Reference in a new issue