projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f417fd
)
Use index in basic activity query.
author
Roger Braun
<rbraun@Bobble.local>
Mon, 23 Oct 2017 16:36:53 +0000
(18:36 +0200)
committer
Roger Braun
<rbraun@Bobble.local>
Mon, 23 Oct 2017 16:36:53 +0000
(18:36 +0200)
lib/pleroma/activity.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/activity.ex
b/lib/pleroma/activity.ex
index d7e31b6b4cdfe92a42ff59abe1ee30bf7b77888d..f43b32b565a502c8338b2d9a655577fc906b1a2b 100644
(file)
--- a/
lib/pleroma/activity.ex
+++ b/
lib/pleroma/activity.ex
@@
-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