CREATE TABLE roles ( id SERIAL NOT NULL PRIMARY KEY, role_name VARCHAR(128) NOT NULL, role_desc VARCHAR(512) NOT NULL, org_id SERIAL NOT NULL REFERENCES organizations(id) ); CREATE INDEX idx_roles_org_id ON roles(org_id); -- every org should have an id=0 role which every node is a member of