commit: 769e02d0de48484d9396fadb030bf5f708f4fd84
parent 991807080bfb35caf32f2403d61dd6ced66a9a50
Author: feld <feld@feld.me>
Date: Mon, 12 Feb 2024 19:37:17 +0000
Merge branch 'notifications-query' into 'develop'
Fix notifications query to use the index
See merge request pleroma/pleroma!4058
Diffstat:
3 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/changelog.d/.search_config.fix.swp b/changelog.d/.search_config.fix.swp
Binary files differ.
diff --git a/changelog.d/notifications-index.fix b/changelog.d/notifications-index.fix
@@ -0,0 +1 @@
+Fix notifications query which was not using the index properly
diff --git a/lib/pleroma/notification.ex b/lib/pleroma/notification.ex
@@ -88,7 +88,7 @@ defmodule Pleroma.Notification do
where: q.seen == true,
select: type(q.id, :string),
limit: 1,
- order_by: [desc: :id]
+ order_by: fragment("? desc nulls last", q.id)
)
end