From 84142f031cc921f7f50faf23454b21228fb42f20 Mon Sep 17 00:00:00 2001 From: dullbananas Date: Fri, 21 Jun 2024 06:47:10 -0700 Subject: [PATCH] Update community_moderator_view.rs --- crates/db_views_actor/src/community_moderator_view.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/db_views_actor/src/community_moderator_view.rs b/crates/db_views_actor/src/community_moderator_view.rs index 468d9ca6e..addc55dfc 100644 --- a/crates/db_views_actor/src/community_moderator_view.rs +++ b/crates/db_views_actor/src/community_moderator_view.rs @@ -88,7 +88,10 @@ impl CommunityModeratorView { // A hacky workaround instead of group_bys // https://stackoverflow.com/questions/24042359/how-to-join-only-one-row-in-joined-table-with-postgres .distinct_on(community_moderator::community_id) - .order_by(community_moderator::published) + .order_by(( + community_moderator::community_id, + community_moderator::published, + )) .load::(conn) .await }