Skip to content

public.org_enabled_modules

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 module enablement, overriding the platform default — Not: platform_enabled_modules; also not org_enabled_capabilities

Name Type Default Nullable Children Parents Comment
created_at timestamp with time zone now() false
enabled_at timestamp with time zone now() true
enabled_by uuid true
id uuid gen_random_uuid() false
module_key text false workspace_modules
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_modules_org FOREIGN KEY FOREIGN KEY (org_id) REFERENCES organizations(id) ON DELETE CASCADE
org_enabled_modules_module_key_fkey FOREIGN KEY FOREIGN KEY (module_key) REFERENCES workspace_modules(module_key) ON DELETE CASCADE
org_enabled_modules_org_id_module_key_key UNIQUE UNIQUE (org_id, module_key)
org_enabled_modules_pkey PRIMARY KEY PRIMARY KEY (id)
Name Definition
org_enabled_modules_org_id_module_key_key CREATE UNIQUE INDEX org_enabled_modules_org_id_module_key_key ON public.org_enabled_modules USING btree (org_id, module_key)
org_enabled_modules_pkey CREATE UNIQUE INDEX org_enabled_modules_pkey ON public.org_enabled_modules USING btree (id)
Name Definition
update_org_enabled_modules_updated_at CREATE TRIGGER update_org_enabled_modules_updated_at BEFORE UPDATE ON public.org_enabled_modules FOR EACH ROW EXECUTE FUNCTION update_updated_at_column()
erDiagram

"public.org_enabled_modules" }o--|| "public.workspace_modules" : "FOREIGN KEY (module_key) REFERENCES workspace_modules(module_key) ON DELETE CASCADE"
"public.org_enabled_modules" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id) ON DELETE CASCADE"

"public.org_enabled_modules" {
  text module_key FK ""
  text org_id FK ""
}
"public.workspace_modules" {
  text module_key ""
}
"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