summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-10-06 17:05:51 +0300
committerrinpatch <rinpatch@sdf.org>2019-10-06 17:23:43 +0300
commit125f96e7064aa0d714c91bf4a0c78c25734c64ef (patch)
treea61fd18c15ff64b35957dd4536b2999843ca9930
parentfefbd31c6e60e25778ed01c522273375d4f04266 (diff)
Fix the use of queries with a schema in a migration
-rw-r--r--priv/repo/migrations/20190711042024_copy_muted_to_muted_notifications.exs9
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 ->