Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ALTER TABLE tag_memberships
- ADD CONSTRAINT tag_memberships_tag_id_fkey FOREIGN KEY (tag_id)
- REFERENCES tags (id) MATCH SIMPLE
- ON UPDATE NO ACTION ON DELETE CASCADE
- ALTER TABLE tag_memberships
- ADD CONSTRAINT tag_memberships_organization_id_fkey1 FOREIGN KEY (organization_id, tag_id)
- REFERENCES tags (organization_id, id) MATCH SIMPLE
- ON UPDATE CASCADE ON DELETE NO ACTION;
- -- Create table script
- CREATE TABLE tag_memberships (
- id uuid NOT NULL,
- tag_id uuid NOT NULL,
- template_id uuid NOT NULL,
- organization_id uuid NOT NULL, -- tenant id
- PRIMARY KEY (id)
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement