start reports/moderation in backend
This commit is contained in:
parent
41edaee8ea
commit
33f903b07d
8 changed files with 136 additions and 2 deletions
19
scripts/migrate/010_reports.sql
Normal file
19
scripts/migrate/010_reports.sql
Normal file
|
@ -0,0 +1,19 @@
|
|||
-- +migrate Up
|
||||
|
||||
-- 2023-03-19: Add moderation-related tables
|
||||
|
||||
alter table users add column is_admin boolean not null default false;
|
||||
|
||||
create table reports (
|
||||
id serial primary key,
|
||||
-- we keep deleted users for 180 days after deletion, so it's fine to tie this to a user object
|
||||
user_id text not null references users (id) on delete cascade,
|
||||
member_id text null references members (id) on delete set null,
|
||||
reason text not null,
|
||||
reporter_id text not null,
|
||||
|
||||
created_at timestamptz not null default now(),
|
||||
resolved_at timestamptz,
|
||||
admin_id text null references users (id) on delete set null,
|
||||
admin_comment text
|
||||
);
|
Loading…
Add table
Add a link
Reference in a new issue