mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-12-05 02:40:43 +00:00
Fix the use of queries with a schema in a migration
This commit is contained in:
parent
c58da11182
commit
a0d336a828
|
@ -1,15 +1,10 @@
|
||||||
defmodule Pleroma.Repo.Migrations.CopyMutedToMutedNotifications do
|
defmodule Pleroma.Repo.Migrations.CopyMutedToMutedNotifications do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
import Ecto.Query
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
|
|
||||||
def change do
|
def change do
|
||||||
query =
|
query = from(u in "users", where: fragment("not (?->'deactivated' @> 'true')", u.info), select: %{info: u.info}, where: u.local == true, order_by: u.id)
|
||||||
User.Query.build(%{
|
|
||||||
local: true,
|
|
||||||
active: true,
|
|
||||||
order_by: :id
|
|
||||||
})
|
|
||||||
|
|
||||||
Pleroma.Repo.stream(query)
|
Pleroma.Repo.stream(query)
|
||||||
|> Enum.each(fn
|
|> Enum.each(fn
|
||||||
%{info: %{mutes: mutes} = info} = user ->
|
%{info: %{mutes: mutes} = info} = user ->
|
||||||
|
|
Loading…
Reference in a new issue