mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 11:19:19 +00:00
Use index in basic activity query.
This commit is contained in:
parent
9f417fd5e9
commit
b35ff8f755
1 changed files with 2 additions and 2 deletions
|
@ -38,7 +38,7 @@ defmodule Pleroma.Activity do
|
|||
|
||||
def get_create_activity_by_object_ap_id(ap_id) do
|
||||
Repo.one(from activity in Activity,
|
||||
where: fragment("(?)->'object'->>'id' = ?", activity.data, ^to_string(ap_id))
|
||||
and fragment("(?)->>'type' = 'Create'", activity.data))
|
||||
where: fragment("coalesce((?)->'object'->>'id', (?)->>'object') = ?", activity.data, activity.data, ^to_string(ap_id)),
|
||||
where: fragment("(?)->>'type' = 'Create'", activity.data))
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue