projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into issue/1936
[akkoma]
/
priv
/
repo
/
migrations
/
20190710125158_add_following_address_from_source_data.exs
diff --git
a/priv/repo/migrations/20190710125158_add_following_address_from_source_data.exs
b/priv/repo/migrations/20190710125158_add_following_address_from_source_data.exs
index 779aa382e903d6081a8c293d864928cbd6e8d79b..44f9891b1cc06c103d7a329035b9b27d18640bf7 100644
(file)
--- a/
priv/repo/migrations/20190710125158_add_following_address_from_source_data.exs
+++ b/
priv/repo/migrations/20190710125158_add_following_address_from_source_data.exs
@@
-1,11
+1,16
@@
defmodule Pleroma.Repo.Migrations.AddFollowingAddressFromSourceData do
defmodule Pleroma.Repo.Migrations.AddFollowingAddressFromSourceData do
- use Ecto.Migration
- import Ecto.Query
alias Pleroma.User
alias Pleroma.User
+ import Ecto.Query
+ require Logger
+ use Ecto.Migration
def change do
query =
def change do
query =
- User.external_users_query()
+ User.Query.build(%{
+ external: true,
+ legacy_active: true,
+ order_by: :id
+ })
|> select([u], struct(u, [:id, :ap_id, :info]))
Pleroma.Repo.stream(query)
|> select([u], struct(u, [:id, :ap_id, :info]))
Pleroma.Repo.stream(query)
@@
-15,6
+20,9
@@
defmodule Pleroma.Repo.Migrations.AddFollowingAddressFromSourceData do
:following_address
])
|> Pleroma.Repo.update()
:following_address
])
|> Pleroma.Repo.update()
+
+ user ->
+ Logger.warn("User #{user.id} / #{user.nickname} does not seem to have source_data")
end)
end
end
end)
end
end