diff options
Diffstat (limited to 'db/schema.sql')
-rw-r--r-- | db/schema.sql | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/db/schema.sql b/db/schema.sql index 6ddb7bae6..5bac02bce 100644 --- a/db/schema.sql +++ b/db/schema.sql @@ -450,5 +450,35 @@ create table admin_log ( ), object_id integer not null, action text not null, - whenedited timestamp not null default ms_current_timestamp() + whenedited timestamp not null default ms_current_timestamp(), + user_id int references users(id) null, + reason text not null default '' ); + +create table moderation_original_data ( + id serial not null primary key, + + -- Problem details + problem_id int references problem(id) ON DELETE CASCADE not null, + comment_id int references comment(id) ON DELETE CASCADE unique, + + title text null, + detail text null, -- or text for comment + photo bytea, + anonymous bool not null, + + -- Metadata + created timestamp not null default ms_current_timestamp() +); + +create table user_body_permissions ( + id serial not null primary key, + user_id int references users(id) not null, + body_id int references body(id) not null, + permission_type text not null check( + permission_type='moderate' or + -- for future expansion -- + permission_type='admin' + ), + unique(user_id, body_id, permission_type) +); |