]> Untitled Git - lemmy.git/blob - migrations/2019-08-29-040006_add_community_count/down.sql
Revert "Attempt to fix CI building wrong commits (#3830)"
[lemmy.git] / migrations / 2019-08-29-040006_add_community_count / down.sql
1 DROP VIEW site_view;
2
3 CREATE VIEW site_view AS
4 SELECT
5     *,
6     (
7         SELECT
8             name
9         FROM
10             user_ u
11         WHERE
12             s.creator_id = u.id) AS creator_name,
13     (
14         SELECT
15             count(*)
16         FROM
17             user_) AS number_of_users,
18     (
19         SELECT
20             count(*)
21         FROM
22             post) AS number_of_posts,
23     (
24         SELECT
25             count(*)
26         FROM
27             comment) AS number_of_comments
28 FROM
29     site s;
30