]> Untitled Git - lemmy.git/commitdiff
Specify order for activities query (fixes #1436)
authorFelix Ableitner <me@nutomic.com>
Thu, 18 Feb 2021 15:15:52 +0000 (16:15 +0100)
committerFelix Ableitner <me@nutomic.com>
Thu, 18 Feb 2021 15:15:52 +0000 (16:15 +0100)
crates/db_queries/src/source/activity.rs

index b32c8f981bb46d94ceded4e1d4057fcba528f4ba..ad71e88dcc8ffde30a047bf97d0dcd84e221c094 100644 (file)
@@ -110,7 +110,8 @@ impl Activity_ for Activity {
           .sql(" AND activity.data -> 'object' ->> 'type' = 'Create'")
           .sql(" AND activity.data -> 'object' -> 'object' ->> 'type' = 'Page'")
           .sql(" AND activity.data ->> 'actor' = ")
-          .bind::<Text, _>(community_actor_id),
+          .bind::<Text, _>(community_actor_id)
+          .sql(" ORDER BY activity.id DESC"),
       )
       .limit(20)
       .get_results(conn)?;