Use desc id to sort instead of desc inserted_at

Should mean the same and is indexed.
This commit is contained in:
Roger Braun 2017-09-17 11:16:08 +02:00
commit 678dd4c8ec
3 changed files with 3 additions and 3 deletions

View file

@ -21,7 +21,7 @@ defmodule Pleroma.Web.OStatus.OStatusController do
query = from activity in Activity,
where: fragment("?->>'actor' = ?", activity.data, ^user.ap_id),
limit: 20,
order_by: [desc: :inserted_at]
order_by: [desc: :id]
activities = query
|> Repo.all