]> Untitled Git - lemmy.git/blob - migrations/2023-01-17-165819_cleanup_post_aggregates_indexes/down.sql
fix submodule error
[lemmy.git] / migrations / 2023-01-17-165819_cleanup_post_aggregates_indexes / down.sql
1 -- Drop the new indexes
2 DROP INDEX idx_post_aggregates_featured_local_newest_comment_time, idx_post_aggregates_featured_community_newest_comment_time, idx_post_aggregates_featured_local_comments, idx_post_aggregates_featured_community_comments, idx_post_aggregates_featured_local_hot, idx_post_aggregates_featured_community_hot, idx_post_aggregates_featured_local_active, idx_post_aggregates_featured_community_active, idx_post_aggregates_featured_local_score, idx_post_aggregates_featured_community_score, idx_post_aggregates_featured_local_published, idx_post_aggregates_featured_community_published;
3
4 -- Create the old indexes
5 CREATE INDEX idx_post_aggregates_newest_comment_time ON post_aggregates (newest_comment_time DESC);
6
7 CREATE INDEX idx_post_aggregates_comments ON post_aggregates (comments DESC);
8
9 CREATE INDEX idx_post_aggregates_hot ON post_aggregates (hot_rank (score, published) DESC, published DESC);
10
11 CREATE INDEX idx_post_aggregates_active ON post_aggregates (hot_rank (score, newest_comment_time) DESC, newest_comment_time DESC);
12
13 CREATE INDEX idx_post_aggregates_score ON post_aggregates (score DESC);
14
15 CREATE INDEX idx_post_aggregates_published ON post_aggregates (published DESC);
16