--up

-- prevent distinct users from creating projects with the same uuid
ALTER TABLE projects ADD CONSTRAINT project_uuids_same_implies_user_id_same EXCLUDE USING gist (uuid WITH =, user_id WITH <>);

--down

ALTER TABLE projects DROP CONSTRAINT project_uuids_same_implies_user_id_same;