mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-01-06 23:30:25 +00:00
Adding users active monthly for community sort. Fixes #1527
This commit is contained in:
parent
fac024b90c
commit
b893085d1f
crates/db_views_actor/src
migrations/2021-04-01-181826_add_community_agg_active_monthly_index
|
@ -193,6 +193,7 @@ impl<'a> CommunityQueryBuilder<'a> {
|
|||
match self.sort {
|
||||
SortType::New => query = query.order_by(community::published.desc()),
|
||||
SortType::TopAll => query = query.order_by(community_aggregates::subscribers.desc()),
|
||||
SortType::TopMonth => query = query.order_by(community_aggregates::users_active_month.desc()),
|
||||
// Covers all other sorts, including hot
|
||||
_ => {
|
||||
query = query
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
drop index idx_community_aggregates_users_active_month;
|
|
@ -0,0 +1,2 @@
|
|||
create index idx_community_aggregates_users_active_month on community_aggregates (users_active_month desc);
|
||||
|
Loading…
Reference in a new issue