Sponsorships
Synced from
docs/generated/erd/— do not hand-edit.
Regenerate withbun 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
Description
Section titled “Description”Sponsorship offerings and bookings, event sponsor slots/fulfillment,
sponsor impressions/placements, package benefits. Catalog §2.3.
(Table names on staging: sponsorships / sponsorship_offerings — not
sponsorship_inventory from older prose.)
Tables
Section titled “Tables”Inventory & bookings
Section titled “Inventory & bookings”Sellable sponsorship inventory and sold bookings
| Name | Columns | Comment | Type |
|---|---|---|---|
| public.benefit_definitions | 10 | Catalog of chamber benefits that member_entitlements allocate — Not: commerce_products (sellable SKUs) | BASE TABLE |
benefit_reservations |
10 | BASE TABLE | |
benefit_usage |
11 | BASE TABLE | |
package_benefits |
8 | BASE TABLE | |
sponsorship_offerings |
23 | BASE TABLE | |
sponsorships |
25 | BASE TABLE |
Event linkage
Section titled “Event linkage”Event-scoped sponsor slots
| Name | Columns | Comment | Type |
|---|---|---|---|
event_sponsor_slots |
9 | BASE TABLE |
Measurement
Section titled “Measurement”Impressions and placements
| Name | Columns | Comment | Type |
|---|---|---|---|
sponsor_impressions |
9 | BASE TABLE | |
sponsor_placements |
14 | BASE TABLE |
Commerce bridge
Section titled “Commerce bridge”Checkout/billing when sponsorship is sold as a billable offer
| Name | Columns | Comment | Type |
|---|---|---|---|
billable_offers |
25 | BASE TABLE | |
billing_agreements |
27 | BASE TABLE |
| Name | Columns | Comment | Type |
|---|---|---|---|
companies |
20 | BASE TABLE | |
| public.members | 17 | Member identity hub row (org-scoped); satellites hold profile/billing/metrics — Not: Full member payload — write profiles/billing/metrics to their tables — See: docs/PLATFORM.md | BASE TABLE |
organizations |
35 | BASE TABLE |
Relations
Section titled “Relations”erDiagram
"public.benefit_definitions" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.benefit_reservations" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.benefit_usage" }o--o| "public.benefit_reservations" : "FOREIGN KEY (reservation_id) REFERENCES benefit_reservations(id) ON DELETE SET NULL"
"public.benefit_usage" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.companies" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.event_sponsor_slots" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.members" }o--o| "public.companies" : "FOREIGN KEY (company_id) REFERENCES companies(id)"
"public.members" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.package_benefits" }o--|| "public.benefit_definitions" : "FOREIGN KEY (benefit_definition_id) REFERENCES benefit_definitions(id) ON DELETE CASCADE"
"public.package_benefits" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.package_benefits" }o--|| "public.sponsorship_offerings" : "FOREIGN KEY (sponsor_package_id) REFERENCES sponsorship_offerings(id) ON DELETE CASCADE"
"public.sponsor_impressions" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.sponsor_impressions" }o--|| "public.sponsorships" : "FOREIGN KEY (subscription_id) REFERENCES sponsorships(id) ON DELETE CASCADE"
"public.sponsor_placements" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.sponsorship_offerings" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.sponsorships" }o--o| "public.companies" : "FOREIGN KEY (company_id) REFERENCES companies(id) ON DELETE SET NULL"
"public.sponsorships" }o--o| "public.members" : "FOREIGN KEY (member_id) REFERENCES members(id) ON DELETE SET NULL"
"public.sponsorships" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.sponsorships" }o--o| "public.sponsorships" : "FOREIGN KEY (subscription_id) REFERENCES sponsorships(id) ON DELETE SET NULL"
"public.sponsorships" }o--|| "public.sponsorship_offerings" : "FOREIGN KEY (offering_id) REFERENCES sponsorship_offerings(id)"
"public.benefit_definitions" {
uuid id ""
text org_id ""
}
"public.benefit_reservations" {
uuid id ""
text org_id ""
}
"public.benefit_usage" {
text org_id ""
uuid reservation_id ""
}
"public.billable_offers" {
}
"public.billing_agreements" {
}
"public.companies" {
uuid id ""
text org_id ""
}
"public.event_sponsor_slots" {
text org_id ""
}
"public.members" {
uuid company_id ""
uuid id ""
text org_id ""
}
"public.organizations" {
text id ""
}
"public.package_benefits" {
uuid benefit_definition_id ""
text org_id ""
uuid sponsor_package_id ""
}
"public.sponsor_impressions" {
text org_id ""
uuid subscription_id ""
}
"public.sponsor_placements" {
text org_id ""
}
"public.sponsorship_offerings" {
uuid id ""
text org_id ""
}
"public.sponsorships" {
uuid company_id ""
uuid id ""
uuid member_id ""
uuid offering_id "#3542: FK to sponsorship_offerings (renamed from tier_id)."
text org_id ""
uuid subscription_id ""
}
Generated by tbls

