]> Untitled Git - lemmy.git/blob - migrations/2023-07-14-154840_add_optimized_indexes_published/down.sql
fix submodule error
[lemmy.git] / migrations / 2023-07-14-154840_add_optimized_indexes_published / down.sql
1 -- Drop the new indexes
2 DROP INDEX idx_post_aggregates_featured_local_most_comments;
3
4 DROP INDEX idx_post_aggregates_featured_local_hot;
5
6 DROP INDEX idx_post_aggregates_featured_local_active;
7
8 DROP INDEX idx_post_aggregates_featured_local_score;
9
10 DROP INDEX idx_post_aggregates_featured_community_hot;
11
12 DROP INDEX idx_post_aggregates_featured_community_active;
13
14 DROP INDEX idx_post_aggregates_featured_community_score;
15
16 DROP INDEX idx_post_aggregates_featured_community_most_comments;
17
18 DROP INDEX idx_comment_aggregates_hot;
19
20 DROP INDEX idx_comment_aggregates_score;
21
22 -- Add the old ones back in
23 -- featured_local
24 CREATE INDEX idx_post_aggregates_featured_local_hot ON post_aggregates (featured_local DESC, hot_rank DESC);
25
26 CREATE INDEX idx_post_aggregates_featured_local_active ON post_aggregates (featured_local DESC, hot_rank_active DESC);
27
28 CREATE INDEX idx_post_aggregates_featured_local_score ON post_aggregates (featured_local DESC, score DESC);
29
30 -- featured_community
31 CREATE INDEX idx_post_aggregates_featured_community_hot ON post_aggregates (featured_community DESC, hot_rank DESC);
32
33 CREATE INDEX idx_post_aggregates_featured_community_active ON post_aggregates (featured_community DESC, hot_rank_active DESC);
34
35 CREATE INDEX idx_post_aggregates_featured_community_score ON post_aggregates (featured_community DESC, score DESC);
36
37 CREATE INDEX idx_comment_aggregates_hot ON comment_aggregates (hot_rank DESC);
38
39 CREATE INDEX idx_comment_aggregates_score ON comment_aggregates (score DESC);
40