lemmy/migrations/2021-10-01-141650_create_admin_purge/up.sql
Dessalines 4e12e25c59
Adding admin purging of DB items and pictures. #904 #1331 (#1809)
* First pass at adding admin purge. #904 #1331

* Breaking out purge into 4 tables for the 4 purgeable types.

* Using CommunitySafe instead in view

* Fix db_schema features flags.

* Attempting to pass API key.

* Adding pictrs image purging

- Added pictrs_config block, for API_KEY
- Clear out image columns after purging

* Remove the remove_images field from a few of the purge API calls.

* Fix some suggestions by @nutomic.

* Add separate pictrs reqwest client.

* Update defaults.hjson

Co-authored-by: Nutomic <me@nutomic.com>
2022-06-13 19:15:04 +00:00

31 lines
1,014 B
SQL

-- Add the admin_purge tables
create table admin_purge_person (
id serial primary key,
admin_person_id int references person on update cascade on delete cascade not null,
reason text,
when_ timestamp not null default now()
);
create table admin_purge_community (
id serial primary key,
admin_person_id int references person on update cascade on delete cascade not null,
reason text,
when_ timestamp not null default now()
);
create table admin_purge_post (
id serial primary key,
admin_person_id int references person on update cascade on delete cascade not null,
community_id int references community on update cascade on delete cascade not null,
reason text,
when_ timestamp not null default now()
);
create table admin_purge_comment (
id serial primary key,
admin_person_id int references person on update cascade on delete cascade not null,
post_id int references post on update cascade on delete cascade not null,
reason text,
when_ timestamp not null default now()
);