1 -- create user follower table with two references to persons
2 CREATE TABLE person_follower (
4 person_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
5 follower_id int REFERENCES person ON UPDATE CASCADE ON DELETE CASCADE NOT NULL,
6 published timestamp NOT NULL DEFAULT now(),
7 pending boolean NOT NULL,
8 UNIQUE (follower_id, person_id)
18 ALTER TABLE community_follower
19 ALTER COLUMN pending SET NOT NULL;