diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-03-28 18:49:03 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2020-03-28 18:49:03 +0300 |
commit | be9d18461a5ed6bd835e2eba8d3b54ba61fc51fb (patch) | |
tree | 0b5b199feab5cef526d365030213170c99fb9f0f /lib/pleroma/user | |
parent | 4e81b4b190161ebb0c496c682fa8e1e0c38a3903 (diff) | |
download | pleroma-be9d18461a5ed6bd835e2eba8d3b54ba61fc51fb.tar.gz |
FollowingRelationship storage & performance optimizations (state turned `ecto_enum`-driven integer, reorganized indices etc.).
Diffstat (limited to 'lib/pleroma/user')
-rw-r--r-- | lib/pleroma/user/query.ex | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pleroma/user/query.ex b/lib/pleroma/user/query.ex index 884e33039..ec88088cf 100644 --- a/lib/pleroma/user/query.ex +++ b/lib/pleroma/user/query.ex @@ -148,7 +148,7 @@ defmodule Pleroma.User.Query do as: :relationships, on: r.following_id == ^id and r.follower_id == u.id ) - |> where([relationships: r], r.state == "accept") + |> where([relationships: r], r.state == ^:follow_accept) end defp compose_query({:friends, %User{id: id}}, query) do @@ -158,7 +158,7 @@ defmodule Pleroma.User.Query do as: :relationships, on: r.following_id == u.id and r.follower_id == ^id ) - |> where([relationships: r], r.state == "accept") + |> where([relationships: r], r.state == ^:follow_accept) end defp compose_query({:recipients_from_activity, to}, query) do @@ -173,7 +173,7 @@ defmodule Pleroma.User.Query do ) |> where( [u, following: f, relationships: r], - u.ap_id in ^to or (f.follower_address in ^to and r.state == "accept") + u.ap_id in ^to or (f.follower_address in ^to and r.state == ^:follow_accept) ) |> distinct(true) end |