Merge branch 'develop' into feature/digest-email
This commit is contained in:
commit
c729883936
41 changed files with 1049 additions and 627 deletions
|
|
@ -0,0 +1,24 @@
|
|||
defmodule Pleroma.Repo.Migrations.CopyMutedToMutedNotifications do
|
||||
use Ecto.Migration
|
||||
alias Pleroma.User
|
||||
|
||||
def change do
|
||||
query =
|
||||
User.Query.build(%{
|
||||
local: true,
|
||||
active: true,
|
||||
order_by: :id
|
||||
})
|
||||
|
||||
Pleroma.Repo.stream(query)
|
||||
|> Enum.each(fn
|
||||
%{info: %{mutes: mutes} = info} = user ->
|
||||
info_cng =
|
||||
Ecto.Changeset.cast(info, %{muted_notifications: mutes}, [:muted_notifications])
|
||||
|
||||
Ecto.Changeset.change(user)
|
||||
|> Ecto.Changeset.put_embed(:info, info_cng)
|
||||
|> Pleroma.Repo.update()
|
||||
end)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue