Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85803671
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
605 B
Referenced Files
None
Subscribers
None
View Options
diff --git a/fix_users.ex b/fix_users.ex
new file mode 100644
index 000000000..11071a1f4
--- /dev/null
+++ b/fix_users.ex
@@ -0,0 +1,21 @@
+alias Pleroma.{User,Repo}
+
+import Ecto.Query
+import Ecto.Changeset
+
+from(
+ u in User,
+ where: fragment("? ->> 'id' IS NULL", u.info),
+ update: [
+ set: [info: nil]
+ ]
+) |> Repo.update_all([])
+
+User
+|> where([user], fragment("? ->> 'id' IS NULL", user.info))
+|> Repo.all()
+|> Enum.each(fn user ->
+ change(user)
+ |> put_embed(:info, %User.Info{locked: true, hide_followers: true, hide_follows: true})
+ |> User.update_and_set_cache()
+end)
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Fri, Oct 9, 10:10 AM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1784688
Default Alt Text
(605 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment