]> Untitled Git - lemmy.git/blob - migrations/2021-10-01-141650_create_admin_purge/up.sql
Revert "Attempt to fix CI building wrong commits (#3830)"
[lemmy.git] / migrations / 2021-10-01-141650_create_admin_purge / up.sql
1 -- Add the admin_purge tables
2 CREATE TABLE admin_purge_person (
3     id serial PRIMARY KEY,
4     admin_person_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
5     reason text,
6     when_ timestamp NOT NULL DEFAULT now()
7 );
8
9 CREATE TABLE admin_purge_community (
10     id serial PRIMARY KEY,
11     admin_person_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
12     reason text,
13     when_ timestamp NOT NULL DEFAULT now()
14 );
15
16 CREATE TABLE admin_purge_post (
17     id serial PRIMARY KEY,
18     admin_person_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
19     community_id int REFERENCES community ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
20     reason text,
21     when_ timestamp NOT NULL DEFAULT now()
22 );
23
24 CREATE TABLE admin_purge_comment (
25     id serial PRIMARY KEY,
26     admin_person_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
27     post_id int REFERENCES post ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
28     reason text,
29     when_ timestamp NOT NULL DEFAULT now()
30 );
31