Skip to content

public.member_product_entitlements

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

External product provisioning (e.g. Bullseye access by product_key) — Not: Commerce SKUs; chamber benefit ledger

Name Type Default Nullable Children Parents Comment
association_id text true
created_at timestamp with time zone now() false
entitlement_status entitlement_status ‘pending’::entitlement_status false
granted_at timestamp with time zone now() true
id uuid gen_random_uuid() false
member_id uuid false public.members
metadata jsonb ‘{}’::jsonb true
org_id text false
product_key product_key false
revoked_at timestamp with time zone true
source entitlement_source ‘manual’::entitlement_source false
updated_at timestamp with time zone now() false
Name Definition
Membership & Billing Members split-payload (members + member_profiles + member_billing + member_metrics),
tiers, commerce/billable offers, billing agreements/subscriptions/transactions.
Catalog §2.1–2.2, 2.4. Strong first-review cluster for Nathan/Craig.
NAMING TRAP — “entitlement” is three different concepts (see docs/db/erd-table-labels.yml):
commerce_entitlements = plan/agreement commercial limits;
member_entitlements = chamber member benefit allocations;
member_product_entitlements = external product provisioning (e.g. Bullseye).
The bare entitlements table is NOT the commerce ledger (ADR #2581).
Name Type Definition
member_product_entitlements_member_id_fkey FOREIGN KEY FOREIGN KEY (member_id) REFERENCES members(id) ON DELETE CASCADE
member_product_entitlements_member_id_product_key_key UNIQUE UNIQUE (member_id, product_key)
member_product_entitlements_pkey PRIMARY KEY PRIMARY KEY (id)
Name Definition
idx_mpe_member CREATE INDEX idx_mpe_member ON public.member_product_entitlements USING btree (member_id)
idx_mpe_org CREATE INDEX idx_mpe_org ON public.member_product_entitlements USING btree (org_id)
idx_mpe_product CREATE INDEX idx_mpe_product ON public.member_product_entitlements USING btree (product_key, entitlement_status)
member_product_entitlements_member_id_product_key_key CREATE UNIQUE INDEX member_product_entitlements_member_id_product_key_key ON public.member_product_entitlements USING btree (member_id, product_key)
member_product_entitlements_pkey CREATE UNIQUE INDEX member_product_entitlements_pkey ON public.member_product_entitlements USING btree (id)
Name Definition
update_member_product_entitlements_updated_at CREATE TRIGGER update_member_product_entitlements_updated_at BEFORE UPDATE ON public.member_product_entitlements FOR EACH ROW EXECUTE FUNCTION update_updated_at_column()
erDiagram

"public.member_product_entitlements" }o--|| "public.members" : "FOREIGN KEY (member_id) REFERENCES members(id) ON DELETE CASCADE"

"public.member_product_entitlements" {
  uuid member_id FK ""
}
"public.members" {
  uuid company_id FK ""
  uuid contact_id FK ""
  uuid id ""
  text org_id FK ""
}

Generated by tbls