From: Dessalines Date: Tue, 1 Feb 2022 20:00:54 +0000 (-0500) Subject: Alpha-ordering community follows. Fixes #2062 (#2079) X-Git-Url: http://these/git/%7BpictshareAvatarThumbnail%28post.creator_avatar%29%7D?a=commitdiff_plain;h=6b1894faf062532a107f91527ae7a6a214e1ee32;p=lemmy.git Alpha-ordering community follows. Fixes #2062 (#2079) --- diff --git a/crates/db_views_actor/src/community_follower_view.rs b/crates/db_views_actor/src/community_follower_view.rs index 7fbbcf85..581d9b57 100644 --- a/crates/db_views_actor/src/community_follower_view.rs +++ b/crates/db_views_actor/src/community_follower_view.rs @@ -28,6 +28,7 @@ impl CommunityFollowerView { Person::safe_columns_tuple(), )) .filter(community_follower::community_id.eq(community_id)) + .order_by(community::title) .load::(conn)?; Ok(Self::from_tuple_to_vec(res)) @@ -42,6 +43,7 @@ impl CommunityFollowerView { Person::safe_columns_tuple(), )) .filter(community_follower::person_id.eq(person_id)) + .order_by(community::title) .load::(conn)?; Ok(Self::from_tuple_to_vec(res)) diff --git a/migrations/2022-02-01-154240_add_community_title_index/down.sql b/migrations/2022-02-01-154240_add_community_title_index/down.sql new file mode 100644 index 00000000..8b927b7b --- /dev/null +++ b/migrations/2022-02-01-154240_add_community_title_index/down.sql @@ -0,0 +1 @@ +drop index idx_community_title; diff --git a/migrations/2022-02-01-154240_add_community_title_index/up.sql b/migrations/2022-02-01-154240_add_community_title_index/up.sql new file mode 100644 index 00000000..50c267bb --- /dev/null +++ b/migrations/2022-02-01-154240_add_community_title_index/up.sql @@ -0,0 +1 @@ +create index idx_community_title on community(title);