~vpzom/lotide

ref: 6f183c37ed24dfe1b8fc69a68f31b10bda3e49bd lotide/migrations/20200709021821_follow-undo/up.sql -rw-r--r-- 489 bytes
6f183c37Colin Reeder Update docs with new env variables 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
BEGIN;
	ALTER TABLE community_follow ADD COLUMN local BOOLEAN;
	UPDATE community_follow SET local=(SELECT local FROM person WHERE id=community_follow.follower);
	ALTER TABLE community_follow ALTER COLUMN local SET NOT NULL;

	ALTER TABLE community_follow ADD COLUMN ap_id TEXT;

	CREATE TABLE local_community_follow_undo (
		id UUID PRIMARY KEY,
		community BIGINT NOT NULL REFERENCES community ON DELETE CASCADE,
		follower BIGINT NOT NULL REFERENCES person ON DELETE CASCADE
	);
COMMIT;