diff options
author | rinpatch <rinpatch@sdf.org> | 2019-10-06 17:05:51 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-10-06 17:36:42 +0300 |
commit | a0d336a8283a15fc29ae88f0498d202d1bef3cce (patch) | |
tree | fd974131e417a33d00545f351dafa14c83d2752a | |
parent | c58da1118279f6c399ea0e32e532d5441b059c56 (diff) | |
download | pleroma-a0d336a8283a15fc29ae88f0498d202d1bef3cce.tar.gz |
Fix the use of queries with a schema in a migration
-rw-r--r-- | priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs b/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs index 50669902e..815d66549 100644 --- a/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs +++ b/priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs @@ -1,15 +1,10 @@ defmodule Pleroma.Repo.Migrations.CopyMutedToMutedNotifications do use Ecto.Migration + import Ecto.Query alias Pleroma.User def change do - query = - User.Query.build(%{ - local: true, - active: true, - order_by: :id - }) - + query = from(u in "users", where: fragment("not (?->'deactivated' @> 'true')", u.info), select: %{info: u.info}, where: u.local == true, order_by: u.id) Pleroma.Repo.stream(query) |> Enum.each(fn %{info: %{mutes: mutes} = info} = user -> |