Skip to content

public.role_definitions

Synced from docs/generated/erd/ — do not hand-edit.
Regenerate with bun run docs:erd (needs staging reader), then this script runs automatically.
Labels: docs/db/erd-table-labels.yml · Runbook: docs/runbooks/erd-schema-docs.md

Catalog of member SERVICE roles (board seat, group post) — descriptive only — Not: rbac_role_definitions — this one confers NO permission of any kind

Name Type Default Nullable Children Parents Comment
category role_category ‘volunteer’::role_category false
created_at timestamp with time zone now() false
description text true
id uuid gen_random_uuid() false public.member_role_assignments
is_active boolean true false
name text false
org_id text ‘’::text false organizations
updated_at timestamp with time zone now() false
Name Definition
Identity, Tenancy & RBAC Org tenancy, contacts/auth linking, seats (organization_users), and M-7 RBAC.
Catalog §1. Seat holds presence only — privilege is rbac_org_user_roles, not
organization_users.role_type (dropped). First review: contacts ↔ contact_auth ↔
organization_users ↔ rbac_*.
Name Type Definition
fk_role_definitions_org FOREIGN KEY FOREIGN KEY (org_id) REFERENCES organizations(id)
role_definitions_pkey PRIMARY KEY PRIMARY KEY (id)
Name Definition
role_definitions_pkey CREATE UNIQUE INDEX role_definitions_pkey ON public.role_definitions USING btree (id)
Name Definition
update_role_definitions_updated_at CREATE TRIGGER update_role_definitions_updated_at BEFORE UPDATE ON public.role_definitions FOR EACH ROW EXECUTE FUNCTION update_updated_at_column()
erDiagram

"public.member_role_assignments" }o--|| "public.role_definitions" : "FOREIGN KEY (role_definition_id) REFERENCES role_definitions(id) ON DELETE CASCADE"
"public.role_definitions" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"

"public.role_definitions" {
  uuid id ""
  text org_id FK ""
}
"public.member_role_assignments" {
  uuid member_id FK ""
  text org_id FK ""
  uuid role_definition_id FK ""
}
"public.organizations" {
  text association_id FK ""
  uuid default_approval_reviewer_contact_id FK "Org-level fallback reviewer for two-step send (#5698). Routing chain: the sender's own reviewer, then this, then all org admins. NULL means fall through to the admins, which is the pre-#5698 behaviour."
  text id ""
  text parent_org_id FK "#671 self-referencing hierarchy pointer. NULL = root org. Direct writes are blocked by trg_block_direct_parent_org_id_writes for every role except service_role/postgres/supabase_admin — the only write path for authenticated/interactive callers is public.reparent_organization(). Cycle-prevented by trg_prevent_org_hierarchy_cycle. #quot;Is association#quot; is derived (EXISTS a child), never stored."
}

Generated by tbls