1 defmodule Pleroma.Repo.Migrations.CopyMutedToMutedNotifications do
7 query = from(u in "users", where: fragment("not (?->'deactivated' @> 'true')", u.info), select: %{info: u.info}, where: u.local == true, order_by: u.id)
8 Pleroma.Repo.stream(query)
10 %{info: %{mutes: mutes} = info} = user ->
12 Ecto.Changeset.cast(info, %{muted_notifications: mutes}, [:muted_notifications])
14 Ecto.Changeset.change(user)
15 |> Ecto.Changeset.put_embed(:info, info_cng)
16 |> Pleroma.Repo.update()