mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-25 12:21:31 +00:00
Nutomic
66a63df152
* Instance blocks with mod log entry and expiration (fixes #2506) * separate table for instance block mod log * fix tests * fix ts * modlog entry for allow instance * fix test cleanup * add back test * clippy * fix check * more changes * move files * update * sql fmt * partly working * fix setup * cleanup * fixes * prettier * try catch * address comments
22 lines
775 B
SQL
22 lines
775 B
SQL
ALTER TABLE federation_blocklist
|
|
ADD COLUMN expires timestamptz;
|
|
|
|
CREATE TABLE admin_block_instance (
|
|
id serial PRIMARY KEY,
|
|
instance_id int NOT NULL REFERENCES instance (id) ON UPDATE CASCADE ON DELETE CASCADE,
|
|
admin_person_id int NOT NULL REFERENCES person (id) ON UPDATE CASCADE ON DELETE CASCADE,
|
|
blocked bool NOT NULL,
|
|
reason text,
|
|
expires timestamptz,
|
|
when_ timestamptz NOT NULL DEFAULT now()
|
|
);
|
|
|
|
CREATE TABLE admin_allow_instance (
|
|
id serial PRIMARY KEY,
|
|
instance_id int NOT NULL REFERENCES instance (id) ON UPDATE CASCADE ON DELETE CASCADE,
|
|
admin_person_id int NOT NULL REFERENCES person (id) ON UPDATE CASCADE ON DELETE CASCADE,
|
|
allowed bool NOT NULL,
|
|
reason text,
|
|
when_ timestamptz NOT NULL DEFAULT now()
|
|
);
|
|
|