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
Per-org capability enablement, overriding the platform default — Not: org_enabled_modules — a module is the coarser grouping
| Name |
Type |
Default |
Nullable |
Children |
Parents |
Comment |
| capability_key |
text |
|
false |
|
workspace_capabilities |
|
| created_at |
timestamp with time zone |
now() |
false |
|
|
|
| enabled_by |
uuid |
|
true |
|
|
|
| id |
uuid |
gen_random_uuid() |
false |
|
|
|
| org_id |
text |
|
false |
|
organizations |
|
| source |
module_source |
‘default’::module_source |
false |
|
|
|
| status |
module_status |
‘active’::module_status |
false |
|
|
|
| updated_at |
timestamp with time zone |
now() |
false |
|
|
|
| Name |
Definition |
| Platform Catalog & Modules |
Permission catalog, workspace/org/platform module & capability toggles, autonomy lane catalog, tab definitions, feature adoption. Catalog §1.3, §1.5.
|
| Name |
Type |
Definition |
| fk_org_enabled_capabilities_org |
FOREIGN KEY |
FOREIGN KEY (org_id) REFERENCES organizations(id) ON DELETE CASCADE |
| org_enabled_capabilities_capability_key_fkey |
FOREIGN KEY |
FOREIGN KEY (capability_key) REFERENCES workspace_capabilities(capability_key) ON DELETE CASCADE |
| org_enabled_capabilities_org_id_capability_key_key |
UNIQUE |
UNIQUE (org_id, capability_key) |
| org_enabled_capabilities_pkey |
PRIMARY KEY |
PRIMARY KEY (id) |
| Name |
Definition |
| org_enabled_capabilities_org_id_capability_key_key |
CREATE UNIQUE INDEX org_enabled_capabilities_org_id_capability_key_key ON public.org_enabled_capabilities USING btree (org_id, capability_key) |
| org_enabled_capabilities_pkey |
CREATE UNIQUE INDEX org_enabled_capabilities_pkey ON public.org_enabled_capabilities USING btree (id) |
| Name |
Definition |
| update_org_enabled_capabilities_updated_at |
CREATE TRIGGER update_org_enabled_capabilities_updated_at BEFORE UPDATE ON public.org_enabled_capabilities FOR EACH ROW EXECUTE FUNCTION update_updated_at_column() |
erDiagram
"public.org_enabled_capabilities" }o--|| "public.workspace_capabilities" : "FOREIGN KEY (capability_key) REFERENCES workspace_capabilities(capability_key) ON DELETE CASCADE"
"public.org_enabled_capabilities" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id) ON DELETE CASCADE"
"public.org_enabled_capabilities" {
text capability_key FK ""
text org_id FK ""
}
"public.workspace_capabilities" {
text capability_key ""
text module_key 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