1 create table mod_remove_post (
3 mod_user_id int references user_ on update cascade on delete cascade not null,
4 post_id int references post on update cascade on delete cascade not null,
6 removed boolean default true,
7 when_ timestamp not null default now()
10 create table mod_lock_post (
11 id serial primary key,
12 mod_user_id int references user_ on update cascade on delete cascade not null,
13 post_id int references post on update cascade on delete cascade not null,
14 locked boolean default true,
15 when_ timestamp not null default now()
18 create table mod_remove_comment (
19 id serial primary key,
20 mod_user_id int references user_ on update cascade on delete cascade not null,
21 comment_id int references comment on update cascade on delete cascade not null,
23 removed boolean default true,
24 when_ timestamp not null default now()
27 create table mod_remove_community (
28 id serial primary key,
29 mod_user_id int references user_ on update cascade on delete cascade not null,
30 community_id int references community on update cascade on delete cascade not null,
32 removed boolean default true,
34 when_ timestamp not null default now()
37 -- TODO make sure you can't ban other mods
38 create table mod_ban_from_community (
39 id serial primary key,
40 mod_user_id int references user_ on update cascade on delete cascade not null,
41 other_user_id int references user_ on update cascade on delete cascade not null,
42 community_id int references community on update cascade on delete cascade not null,
44 banned boolean default true,
46 when_ timestamp not null default now()
49 create table mod_ban (
50 id serial primary key,
51 mod_user_id int references user_ on update cascade on delete cascade not null,
52 other_user_id int references user_ on update cascade on delete cascade not null,
54 banned boolean default true,
56 when_ timestamp not null default now()
59 create table mod_add_community (
60 id serial primary key,
61 mod_user_id int references user_ on update cascade on delete cascade not null,
62 other_user_id int references user_ on update cascade on delete cascade not null,
63 community_id int references community on update cascade on delete cascade not null,
64 removed boolean default false,
65 when_ timestamp not null default now()
68 -- When removed is false that means kicked
69 create table mod_add (
70 id serial primary key,
71 mod_user_id int references user_ on update cascade on delete cascade not null,
72 other_user_id int references user_ on update cascade on delete cascade not null,
73 removed boolean default false,
74 when_ timestamp not null default now()