]> Untitled Git - lemmy.git/blob - migrations/2023-07-04-153335_add_optimized_indexes/down.sql
Revert "Attempt to fix CI building wrong commits (#3830)"
[lemmy.git] / migrations / 2023-07-04-153335_add_optimized_indexes / down.sql
1 -- Drop the new indexes
2 DROP INDEX idx_person_admin;
3
4 DROP INDEX idx_post_aggregates_featured_local_score;
5
6 DROP INDEX idx_post_aggregates_featured_local_newest_comment_time;
7
8 DROP INDEX idx_post_aggregates_featured_local_newest_comment_time_necro;
9
10 DROP INDEX idx_post_aggregates_featured_local_hot;
11
12 DROP INDEX idx_post_aggregates_featured_local_active;
13
14 DROP INDEX idx_post_aggregates_featured_local_published;
15
16 DROP INDEX idx_post_aggregates_published;
17
18 DROP INDEX idx_post_aggregates_featured_community_score;
19
20 DROP INDEX idx_post_aggregates_featured_community_newest_comment_time;
21
22 DROP INDEX idx_post_aggregates_featured_community_newest_comment_time_necro;
23
24 DROP INDEX idx_post_aggregates_featured_community_hot;
25
26 DROP INDEX idx_post_aggregates_featured_community_active;
27
28 DROP INDEX idx_post_aggregates_featured_community_published;
29
30 -- Create single column indexes again
31 CREATE INDEX idx_post_aggregates_score ON post_aggregates (score DESC);
32
33 CREATE INDEX idx_post_aggregates_published ON post_aggregates (published DESC);
34
35 CREATE INDEX idx_post_aggregates_newest_comment_time ON post_aggregates (newest_comment_time DESC);
36
37 CREATE INDEX idx_post_aggregates_newest_comment_time_necro ON post_aggregates (newest_comment_time_necro DESC);
38
39 CREATE INDEX idx_post_aggregates_featured_community ON post_aggregates (featured_community DESC);
40
41 CREATE INDEX idx_post_aggregates_featured_local ON post_aggregates (featured_local DESC);
42
43 CREATE INDEX idx_post_aggregates_hot ON post_aggregates (hot_rank DESC);
44
45 CREATE INDEX idx_post_aggregates_active ON post_aggregates (hot_rank_active DESC);
46