Merge branch 'notifications-query' into 'develop'

Fix notifications query to use the index

See merge request pleroma/pleroma!4058
This commit is contained in:
feld 2024-02-12 19:37:17 +00:00
commit 769e02d0de
3 changed files with 2 additions and 1 deletions

Binary file not shown.

View File

@ -0,0 +1 @@
Fix notifications query which was not using the index properly

View File

@ -88,7 +88,7 @@ defmodule Pleroma.Notification do
where: q.seen == true, where: q.seen == true,
select: type(q.id, :string), select: type(q.id, :string),
limit: 1, limit: 1,
order_by: [desc: :id] order_by: fragment("? desc nulls last", q.id)
) )
end end