1
0
mirror of https://git.pleroma.social/sjw/pleroma.git synced 2025-01-18 11:50:46 +01:00

fix users

This commit is contained in:
Your New SJW Waifu 2021-02-05 08:48:07 -06:00
parent 20daaf22b6
commit 9fd39458eb

21
fix_users.ex Normal file
View File

@ -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)