]> Untitled Git - lemmy.git/blob - server/migrations/2019-08-29-040006_add_community_count/up.sql
routes.api: fix get_captcha endpoint (#1135)
[lemmy.git] / server / migrations / 2019-08-29-040006_add_community_count / up.sql
1 drop view site_view;
2
3 create view site_view as 
4 select *,
5 (select name from user_ u where s.creator_id = u.id) as creator_name,
6 (select count(*) from user_) as number_of_users,
7 (select count(*) from post) as number_of_posts,
8 (select count(*) from comment) as number_of_comments,
9 (select count(*) from community) as number_of_communities
10 from site s;