Use more efficient query.
This commit is contained in:
parent
fe27b61a72
commit
14a9dd468b
@ -12,7 +12,7 @@ defmodule Pleroma.Activity do
|
|||||||
|
|
||||||
def get_by_ap_id(ap_id) do
|
def get_by_ap_id(ap_id) do
|
||||||
Repo.one(from activity in Activity,
|
Repo.one(from activity in Activity,
|
||||||
where: fragment("? @> ?", activity.data, ^%{id: ap_id}))
|
where: fragment("(?)->>'id' = ?", activity.data, ^to_string(ap_id)))
|
||||||
end
|
end
|
||||||
|
|
||||||
def all_by_object_ap_id(ap_id) do
|
def all_by_object_ap_id(ap_id) do
|
||||||
|
Loading…
Reference in New Issue
Block a user