1 create view mod_remove_post_view as
3 (select name from user_ u where mrp.mod_user_id = u.id) as mod_user_name,
4 (select name from post p where mrp.post_id = p.id) as post_name,
5 (select c.id from post p, community c where mrp.post_id = p.id and p.community_id = c.id) as community_id,
6 (select c.name from post p, community c where mrp.post_id = p.id and p.community_id = c.id) as community_name
7 from mod_remove_post mrp;
9 create view mod_lock_post_view as
11 (select name from user_ u where mlp.mod_user_id = u.id) as mod_user_name,
12 (select name from post p where mlp.post_id = p.id) as post_name,
13 (select c.id from post p, community c where mlp.post_id = p.id and p.community_id = c.id) as community_id,
14 (select c.name from post p, community c where mlp.post_id = p.id and p.community_id = c.id) as community_name
15 from mod_lock_post mlp;
17 create view mod_remove_comment_view as
19 (select name from user_ u where mrc.mod_user_id = u.id) as mod_user_name,
20 (select c.id from comment c where mrc.comment_id = c.id) as comment_user_id,
21 (select name from user_ u, comment c where mrc.comment_id = c.id and u.id = c.creator_id) as comment_user_name,
22 (select content from comment c where mrc.comment_id = c.id) as comment_content,
23 (select p.id from post p, comment c where mrc.comment_id = c.id and c.post_id = p.id) as post_id,
24 (select p.name from post p, comment c where mrc.comment_id = c.id and c.post_id = p.id) as post_name,
25 (select co.id from comment c, post p, community co where mrc.comment_id = c.id and c.post_id = p.id and p.community_id = co.id) as community_id,
26 (select co.name from comment c, post p, community co where mrc.comment_id = c.id and c.post_id = p.id and p.community_id = co.id) as community_name
27 from mod_remove_comment mrc;
29 create view mod_remove_community_view as
31 (select name from user_ u where mrc.mod_user_id = u.id) as mod_user_name,
32 (select c.name from community c where mrc.community_id = c.id) as community_name
33 from mod_remove_community mrc;
35 create view mod_ban_from_community_view as
37 (select name from user_ u where mb.mod_user_id = u.id) as mod_user_name,
38 (select name from user_ u where mb.other_user_id = u.id) as other_user_name,
39 (select name from community c where mb.community_id = c.id) as community_name
40 from mod_ban_from_community mb;
42 create view mod_ban_view as
44 (select name from user_ u where mb.mod_user_id = u.id) as mod_user_name,
45 (select name from user_ u where mb.other_user_id = u.id) as other_user_name
48 create view mod_add_community_view as
50 (select name from user_ u where ma.mod_user_id = u.id) as mod_user_name,
51 (select name from user_ u where ma.other_user_id = u.id) as other_user_name,
52 (select name from community c where ma.community_id = c.id) as community_name
53 from mod_add_community ma;
55 create view mod_add_view as
57 (select name from user_ u where ma.mod_user_id = u.id) as mod_user_name,
58 (select name from user_ u where ma.other_user_id = u.id) as other_user_name