]> Untitled Git - lemmy.git/blob - migrations/2021-08-04-223559_create_user_community_block/up.sql
Revert "Attempt to fix CI building wrong commits (#3830)"
[lemmy.git] / migrations / 2021-08-04-223559_create_user_community_block / up.sql
1 CREATE TABLE person_block (
2     id serial PRIMARY KEY,
3     person_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
4     target_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
5     published timestamp NOT NULL DEFAULT now(),
6     UNIQUE (person_id, target_id)
7 );
8
9 CREATE TABLE community_block (
10     id serial PRIMARY KEY,
11     person_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
12     community_id int REFERENCES community ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
13     published timestamp NOT NULL DEFAULT now(),
14     UNIQUE (person_id, community_id)
15 );
16