]> Untitled Git - lemmy.git/blob - migrations/2021-10-01-141650_create_admin_purge/up.sql
Optimize hot rank updates (#3617)
[lemmy.git] / migrations / 2021-10-01-141650_create_admin_purge / up.sql
1 -- Add the admin_purge tables
2
3 create table admin_purge_person (
4   id serial primary key,
5   admin_person_id int references person on update cascade on delete cascade not null,
6   reason text,
7   when_ timestamp not null default now()
8 );
9
10 create table admin_purge_community (
11   id serial primary key,
12   admin_person_id int references person on update cascade on delete cascade not null,
13   reason text,
14   when_ timestamp not null default now()
15 );
16
17 create table admin_purge_post (
18   id serial primary key,
19   admin_person_id int references person on update cascade on delete cascade not null,
20   community_id int references community on update cascade on delete cascade not null,
21   reason text,
22   when_ timestamp not null default now()
23 );
24
25 create table admin_purge_comment (
26   id serial primary key,
27   admin_person_id int references person on update cascade on delete cascade not null,
28   post_id int references post on update cascade on delete cascade not null,
29   reason text,
30   when_ timestamp not null default now()
31 );