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
THE event row — everything on the calendar, public or member-only — Not: signature_events (a planning workspace) or event_templates (a blueprint)
| Name |
Type |
Default |
Nullable |
Children |
Parents |
Comment |
| access_type |
chamber_event_access_type |
‘open’::chamber_event_access_type |
false |
|
|
Who may register. members_only = invisible + closed to non-members. members_and_invited = visible to all but requires a chamber_event_invitations row. open = anyone may register (subject to org.comp_event_limit for prospects). Issue #1244. |
| address |
text |
|
true |
|
|
|
| approval_status |
text |
‘not_required’::text |
false |
|
|
|
| auto_generate_sequence |
boolean |
true |
false |
|
|
|
| capacity |
integer |
100 |
false |
|
|
|
| checked_in_count |
integer |
0 |
false |
|
|
|
| city |
text |
|
true |
|
|
|
| contact |
jsonb |
|
true |
|
|
|
| country |
text |
‘US’::text |
true |
|
|
|
| cover_image_url |
text |
|
true |
|
|
|
| created_at |
timestamp with time zone |
now() |
false |
|
|
|
| currency |
text |
‘usd’::text |
false |
|
|
|
| description |
text |
‘’::text |
true |
|
|
|
| early_bird_deadline |
timestamp with time zone |
|
true |
|
|
Optional cutoff after which early_bird_price no longer applies. #2832. |
| early_bird_price |
numeric |
|
true |
|
|
Optional discounted price for registrations before early_bird_deadline; applies to all registrants (capped at the normal price at checkout). #2832. |
| end_date |
timestamp with time zone |
|
true |
|
|
|
| event_format |
event_format |
‘in_person’::event_format |
false |
|
|
Format for public badges and form UX: in_person | virtual | hybrid (#3992). Was venue_mode. |
| event_structure |
text |
‘large_group’::text |
false |
|
|
Event structure: large_group | small_group | 1_to_many | structured_1_to_1 (#3992). Was format_type. |
| event_type |
text |
‘mixer’::text |
false |
|
|
|
| feedback_survey_id |
uuid |
|
true |
|
registration_forms |
|
| group_id |
uuid |
|
true |
|
groups |
The group this event is a meeting of (#4961 Phase 3 / decision 6). NULL for ordinary chamber events. Same-org membership is enforced by trg_chamber_events_group_org_guard, not by the FK. ON DELETE SET NULL keeps the event as ordinary history if the group is removed — CASCADE would destroy attendance records, RESTRICT would make a group undeletable forever. |
| hero_image_url |
text |
|
true |
|
|
|
| highlights |
jsonb |
|
true |
|
|
|
| host_company_name |
text |
|
true |
|
|
|
| host_contact_id |
uuid |
|
true |
|
public.contacts |
|
| id |
uuid |
gen_random_uuid() |
false |
chamber_event_check_ins chamber_event_invitations chamber_event_registrations chamber_event_series chamber_event_ticket_types chamber_event_waitlist connection_outcomes content_pieces email_campaigns event_approval_tokens event_connection_intents event_connection_suggestions event_content event_email_sequences event_feedback event_photos event_poll_dates event_promo_codes event_sessions event_slug_history event_speakers event_sponsor_slots event_staff_assignments event_testimonial_consents journeys location_bookings registration_form_submissions seating_tables signature_event_linked_events sponsorship_inventory sponsorship_offerings sponsorships value_events video_assets |
|
|
| include_in_monthly_digest |
boolean |
true |
false |
|
|
|
| include_in_weekly_digest |
boolean |
true |
false |
|
|
|
| is_cancelled |
boolean |
false |
false |
|
|
|
| is_customized |
boolean |
false |
false |
|
|
#4366 true after an admin edits a series-owned field on this occurrence; series-wide cascade skips it. Location/time are always occurrence-owned and never use this flag. |
| is_member_hosted |
boolean |
false |
false |
|
|
|
| is_series_exception |
boolean |
false |
false |
|
|
#4366 reserved for future exception semantics; app currently always writes false at materialization. |
| lifecycle_stage |
lifecycle_stage |
‘engage’::lifecycle_stage |
false |
|
|
|
| location |
text |
‘’::text |
false |
|
|
|
| location_id |
uuid |
|
true |
|
locations |
FK to locations (#3997, epic #3987 T4). NULL means the event still uses the legacy free-text location/venue_name/address/city/region/postal_code/country fields as the render source. Attaching a location does not clear those columns — they remain a fallback and an audit trail. |
| location_notes |
text |
|
true |
|
|
One-off staff directions for this specific event, distinct from locations.availability_notes (which is location-wide, not event-specific). |
| location_room_id |
uuid |
|
true |
|
location_rooms |
Optional FK to location_rooms, only meaningful when location_id is set. Enforced same-location membership via trg_chamber_events_location_org_guard, not a DB constraint (no CHECK can join to another table). |
| member_price |
numeric |
0 |
false |
|
|
|
| name |
text |
|
false |
|
|
|
| non_member_price |
numeric |
0 |
false |
|
|
|
| non_members_allowed |
boolean |
true |
false |
|
|
|
| occurrence_date |
date |
|
true |
|
|
#4366 denormalized calendar date for materializer idempotency (UNIQUE with recurrence_series_id). |
| org_id |
text |
‘’::text |
false |
|
organizations |
|
| outcome_type |
text |
‘connection’::text |
false |
|
|
|
| post_event_ai_summary |
text |
|
true |
|
|
|
| post_event_content_ready |
boolean |
false |
false |
|
|
|
| post_event_summary |
text |
|
true |
|
|
|
| post_event_testimonials |
jsonb |
‘[]’::jsonb |
true |
|
|
|
| postal_code |
text |
|
true |
|
|
|
| public_slug |
text |
|
true |
|
|
|
| recurrence_series_id |
uuid |
|
true |
|
chamber_event_series |
#4366/#771 FK to chamber_event_series. ON DELETE SET NULL — never cascade-delete events with live registrations. |
| region |
text |
|
true |
|
|
|
| registered_count |
integer |
0 |
false |
|
|
|
| registration_deadline |
timestamp with time zone |
|
true |
|
|
|
| registration_form_id |
uuid |
|
true |
|
registration_forms |
|
| registration_open |
boolean |
true |
false |
|
|
|
| registration_survey_id |
uuid |
|
true |
|
registration_forms |
|
| registration_url |
text |
|
true |
|
|
|
| review_notes |
text |
|
true |
|
|
|
| reviewed_at |
timestamp with time zone |
|
true |
|
|
|
| reviewed_by |
uuid |
|
true |
|
public.contacts |
|
| short_description |
text |
|
true |
|
|
|
| speaker |
jsonb |
|
true |
|
|
|
| sponsor_registration_url |
text |
|
true |
|
|
|
| sponsorable |
boolean |
false |
false |
|
|
|
| start_date |
timestamp with time zone |
now() |
false |
|
|
|
| status |
text |
‘draft’::text |
false |
|
|
|
| submitted_at |
timestamp with time zone |
|
true |
|
|
|
| submitted_by_contact_id |
uuid |
|
true |
|
public.contacts |
|
| subtitle |
text |
|
true |
|
|
|
| tags |
text[] |
‘{}’::text[] |
true |
|
|
|
| timezone |
text |
|
true |
|
|
|
| total_revenue |
numeric |
0 |
false |
|
|
|
| updated_at |
timestamp with time zone |
now() |
false |
|
|
|
| venue_name |
text |
‘’::text |
true |
|
|
|
| virtual_meeting_url |
text |
|
true |
|
|
|
| waitlist_enabled |
boolean |
true |
false |
|
|
|
| Name |
Definition |
| Events & Registration |
Chamber events, ticket types, registrations, check-ins, sessions/speakers, promo codes, registration forms, signature events (core). Catalog §3.1.
|
| Name |
Type |
Definition |
| chamber_events_approval_status_check |
CHECK |
CHECK ((approval_status = ANY (ARRAY[‘not_required’::text, ‘pending’::text, ‘approved’::text, ‘rejected’::text]))) |
| chamber_events_feedback_survey_id_fkey |
FOREIGN KEY |
FOREIGN KEY (feedback_survey_id) REFERENCES registration_forms(id) ON DELETE SET NULL |
| chamber_events_group_id_fkey |
FOREIGN KEY |
FOREIGN KEY (group_id) REFERENCES groups(id) ON DELETE SET NULL |
| chamber_events_highlights_is_array_chk |
CHECK |
CHECK (((highlights IS NULL) OR (jsonb_typeof(highlights) = ‘array’::text))) |
| chamber_events_host_contact_id_fkey |
FOREIGN KEY |
FOREIGN KEY (host_contact_id) REFERENCES contacts(id) ON DELETE SET NULL |
| chamber_events_location_id_fkey |
FOREIGN KEY |
FOREIGN KEY (location_id) REFERENCES locations(id) ON DELETE RESTRICT |
| chamber_events_location_room_id_fkey |
FOREIGN KEY |
FOREIGN KEY (location_room_id) REFERENCES location_rooms(id) ON DELETE RESTRICT |
| chamber_events_pkey |
PRIMARY KEY |
PRIMARY KEY (id) |
| chamber_events_public_slug_key |
UNIQUE |
UNIQUE (public_slug) |
| chamber_events_recurrence_series_id_fkey |
FOREIGN KEY |
FOREIGN KEY (recurrence_series_id) REFERENCES chamber_event_series(id) ON DELETE SET NULL |
| chamber_events_registration_form_id_fkey |
FOREIGN KEY |
FOREIGN KEY (registration_form_id) REFERENCES registration_forms(id) |
| chamber_events_registration_survey_id_fkey |
FOREIGN KEY |
FOREIGN KEY (registration_survey_id) REFERENCES registration_forms(id) ON DELETE SET NULL |
| chamber_events_reviewed_by_fkey |
FOREIGN KEY |
FOREIGN KEY (reviewed_by) REFERENCES contacts(id) ON DELETE SET NULL |
| chamber_events_submitted_by_contact_id_fkey |
FOREIGN KEY |
FOREIGN KEY (submitted_by_contact_id) REFERENCES contacts(id) ON DELETE SET NULL |
| chamber_events_timezone_iana_chk |
CHECK |
CHECK (((timezone IS NULL) OR (timezone ~ ‘^[A-Za-z][A-Za-z0-9_+-](/[A-Za-z][A-Za-z0-9_+-]){1,2}$’::text))) |
| fk_chamber_events_org |
FOREIGN KEY |
FOREIGN KEY (org_id) REFERENCES organizations(id) |
| Name |
Definition |
| chamber_events_feedback_survey_idx |
CREATE INDEX chamber_events_feedback_survey_idx ON public.chamber_events USING btree (feedback_survey_id) WHERE (feedback_survey_id IS NOT NULL) |
| chamber_events_org_id_status_start_idx |
CREATE INDEX chamber_events_org_id_status_start_idx ON public.chamber_events USING btree (org_id, status, start_date) |
| chamber_events_pkey |
CREATE UNIQUE INDEX chamber_events_pkey ON public.chamber_events USING btree (id) |
| chamber_events_public_slug_key |
CREATE UNIQUE INDEX chamber_events_public_slug_key ON public.chamber_events USING btree (public_slug) |
| chamber_events_registration_survey_idx |
CREATE INDEX chamber_events_registration_survey_idx ON public.chamber_events USING btree (registration_survey_id) WHERE (registration_survey_id IS NOT NULL) |
| idx_chamber_events_group |
CREATE INDEX idx_chamber_events_group ON public.chamber_events USING btree (group_id) WHERE (group_id IS NOT NULL) |
| idx_chamber_events_location_id |
CREATE INDEX idx_chamber_events_location_id ON public.chamber_events USING btree (location_id) WHERE (location_id IS NOT NULL) |
| idx_chamber_events_location_room_id |
CREATE INDEX idx_chamber_events_location_room_id ON public.chamber_events USING btree (location_room_id) WHERE (location_room_id IS NOT NULL) |
| idx_chamber_events_org |
CREATE INDEX idx_chamber_events_org ON public.chamber_events USING btree (org_id) |
| idx_chamber_events_org_status |
CREATE INDEX idx_chamber_events_org_status ON public.chamber_events USING btree (org_id, status) |
| idx_chamber_events_recurrence_series |
CREATE INDEX idx_chamber_events_recurrence_series ON public.chamber_events USING btree (recurrence_series_id) WHERE (recurrence_series_id IS NOT NULL) |
| idx_chamber_events_submission_queue |
CREATE INDEX idx_chamber_events_submission_queue ON public.chamber_events USING btree (org_id, approval_status, submitted_at) WHERE (is_member_hosted = true) |
| uq_chamber_events_series_occurrence_date |
CREATE UNIQUE INDEX uq_chamber_events_series_occurrence_date ON public.chamber_events USING btree (recurrence_series_id, occurrence_date) |
| Name |
Definition |
| chamber_events_series_same_org |
CREATE TRIGGER chamber_events_series_same_org BEFORE INSERT OR UPDATE OF recurrence_series_id, org_id ON public.chamber_events FOR EACH ROW EXECUTE FUNCTION chamber_events_series_same_org() |
| chamber_events_sync_access_type |
CREATE TRIGGER chamber_events_sync_access_type BEFORE INSERT OR UPDATE OF access_type, non_members_allowed ON public.chamber_events FOR EACH ROW EXECUTE FUNCTION _sync_chamber_event_access_type() |
| trg_chamber_events_block_delete_with_campaigns |
CREATE TRIGGER trg_chamber_events_block_delete_with_campaigns BEFORE DELETE ON public.chamber_events FOR EACH ROW EXECUTE FUNCTION block_delete_referenced_by_campaign(‘event’) |
| trg_chamber_events_group_org_guard |
CREATE TRIGGER trg_chamber_events_group_org_guard BEFORE INSERT OR UPDATE OF group_id, org_id ON public.chamber_events FOR EACH ROW EXECUTE FUNCTION chamber_events_group_org_guard() |
| trg_chamber_events_location_org_guard |
CREATE TRIGGER trg_chamber_events_location_org_guard BEFORE INSERT OR UPDATE OF location_id, location_room_id, org_id ON public.chamber_events FOR EACH ROW EXECUTE FUNCTION chamber_events_location_org_guard() |
| trg_chamber_events_slug_history |
CREATE TRIGGER trg_chamber_events_slug_history AFTER UPDATE OF public_slug ON public.chamber_events FOR EACH ROW EXECUTE FUNCTION capture_event_slug_history() |
erDiagram
"public.chamber_events" }o--o| "public.registration_forms" : "FOREIGN KEY (feedback_survey_id) REFERENCES registration_forms(id) ON DELETE SET NULL"
"public.chamber_events" }o--o| "public.groups" : "FOREIGN KEY (group_id) REFERENCES groups(id) ON DELETE SET NULL"
"public.chamber_events" }o--o| "public.contacts" : "FOREIGN KEY (host_contact_id) REFERENCES contacts(id) ON DELETE SET NULL"
"public.chamber_event_check_ins" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.chamber_event_invitations" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.chamber_event_registrations" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.chamber_event_series" }o--|| "public.chamber_events" : "FOREIGN KEY (template_event_id) REFERENCES chamber_events(id)"
"public.chamber_event_ticket_types" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.chamber_event_waitlist" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.connection_outcomes" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id)"
"public.content_pieces" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE SET NULL"
"public.email_campaigns" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE RESTRICT"
"public.event_approval_tokens" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_connection_intents" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_connection_suggestions" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_content" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_email_sequences" |o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_feedback" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_photos" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_poll_dates" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_promo_codes" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_sessions" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_slug_history" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_speakers" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_sponsor_slots" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_staff_assignments" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.event_testimonial_consents" }o--|| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE RESTRICT"
"public.journeys" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE SET NULL"
"public.location_bookings" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE SET NULL"
"public.registration_form_submissions" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id)"
"public.seating_tables" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.signature_event_linked_events" }o--|| "public.chamber_events" : "FOREIGN KEY (chamber_event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.sponsorship_inventory" }o--o| "public.chamber_events" : "FOREIGN KEY (linked_event_id) REFERENCES chamber_events(id) ON DELETE SET NULL"
"public.sponsorship_offerings" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.sponsorships" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE SET NULL"
"public.value_events" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE CASCADE"
"public.video_assets" }o--o| "public.chamber_events" : "FOREIGN KEY (event_id) REFERENCES chamber_events(id) ON DELETE SET NULL"
"public.chamber_events" }o--o| "public.locations" : "FOREIGN KEY (location_id) REFERENCES locations(id) ON DELETE RESTRICT"
"public.chamber_events" }o--o| "public.location_rooms" : "FOREIGN KEY (location_room_id) REFERENCES location_rooms(id) ON DELETE RESTRICT"
"public.chamber_events" }o--|| "public.organizations" : "FOREIGN KEY (org_id) REFERENCES organizations(id)"
"public.chamber_events" }o--o| "public.chamber_event_series" : "FOREIGN KEY (recurrence_series_id) REFERENCES chamber_event_series(id) ON DELETE SET NULL"
"public.chamber_events" }o--o| "public.registration_forms" : "FOREIGN KEY (registration_form_id) REFERENCES registration_forms(id)"
"public.chamber_events" }o--o| "public.registration_forms" : "FOREIGN KEY (registration_survey_id) REFERENCES registration_forms(id) ON DELETE SET NULL"
"public.chamber_events" }o--o| "public.contacts" : "FOREIGN KEY (reviewed_by) REFERENCES contacts(id) ON DELETE SET NULL"
"public.chamber_events" }o--o| "public.contacts" : "FOREIGN KEY (submitted_by_contact_id) REFERENCES contacts(id) ON DELETE SET NULL"
"public.chamber_events" {
uuid feedback_survey_id FK ""
uuid group_id FK "The group this event is a meeting of (#4961 Phase 3 / decision 6). NULL for ordinary chamber events. Same-org membership is enforced by trg_chamber_events_group_org_guard, not by the FK. ON DELETE SET NULL keeps the event as ordinary history if the group is removed — CASCADE would destroy attendance records, RESTRICT would make a group undeletable forever."
uuid host_contact_id FK ""
uuid id ""
uuid location_id FK "FK to locations (#3997, epic #3987 T4). NULL means the event still uses the legacy free-text location/venue_name/address/city/region/postal_code/country fields as the render source. Attaching a location does not clear those columns — they remain a fallback and an audit trail."
uuid location_room_id FK "Optional FK to location_rooms, only meaningful when location_id is set. Enforced same-location membership via trg_chamber_events_location_org_guard, not a DB constraint (no CHECK can join to another table)."
text org_id FK ""
uuid recurrence_series_id FK "#4366/#771 FK to chamber_event_series. ON DELETE SET NULL — never cascade-delete events with live registrations."
uuid registration_form_id FK ""
uuid registration_survey_id FK ""
uuid reviewed_by FK ""
uuid submitted_by_contact_id FK ""
}
"public.registration_forms" {
uuid id ""
text org_id FK ""
}
"public.groups" {
uuid chair_member_id FK ""
uuid id ""
uuid meeting_location_id FK "FK to the Location library (#3994) for a group that meets at a place the org already manages. NULL for a group whose meeting place is only meeting_location free text. Same-org membership is enforced by trg_groups_meeting_location_org_guard, not by the FK — no FK or CHECK can express a cross-table tenancy rule."
text org_id FK ""
}
"public.contacts" {
uuid id ""
text primary_org_id FK ""
text source_org_id FK ""
}
"public.chamber_event_check_ins" {
uuid event_id FK ""
uuid registration_id FK ""
}
"public.chamber_event_invitations" {
uuid contact_id FK ""
uuid event_id FK ""
uuid invited_by FK ""
}
"public.chamber_event_registrations" {
uuid contact_id FK "Identity root for a prospect registration. NULL on legacy / member rows. When member_id IS NULL AND contact_id IS NOT NULL, the row counts against org.comp_event_limit. Issue #1244."
uuid event_id FK ""
uuid id ""
uuid member_id FK ""
uuid ticket_type_id FK ""
}
"public.chamber_event_series" {
uuid id ""
text org_id FK ""
uuid template_event_id FK "Occurrence #1 / series-owned field source. No ON DELETE CASCADE — block template delete while series is active."
}
"public.chamber_event_ticket_types" {
uuid event_id FK ""
uuid id ""
}
"public.chamber_event_waitlist" {
uuid event_id FK ""
uuid member_id FK ""
text org_id FK ""
uuid registration_id FK ""
}
"public.connection_outcomes" {
uuid directive_id FK ""
uuid event_id FK ""
text org_id FK ""
uuid related_member_id FK ""
}
"public.content_pieces" {
uuid author_id FK ""
uuid campaign_id FK ""
uuid content_format_id FK ""
uuid event_id FK "Content Studio B8 (#2530): the chamber_events event this piece is comms FOR (promote/remind/live/recap/follow-up), grouped into a lifecycle series via series_id. Nullable; SET NULL on event delete. Copy-only — never writes back to chamber_events (registration/ticketing/logistics untouched)."
uuid id ""
text org_id FK ""
uuid pillar_id FK "Content Studio D2 (#2544): if set, this piece is a SPOKE — a slant on the referenced pillar content_piece, attributed to it, not free-standing content. Self-FK, nullable, SET NULL on pillar delete. Feeds B6 series atomization."
uuid voice_profile_id FK ""
}
"public.email_campaigns" {
uuid event_id FK "When set, send-campaign resolves recipients from this event's registrants (#4293). ON DELETE RESTRICT (#4408): the audience intent lives only in this column, so the event delete must fail rather than silently widen the campaign to the whole org."
uuid id ""
text org_id FK ""
uuid segment_id FK "When set, recipients are the members matching this segment. ON DELETE RESTRICT (#4408): same reason as event_id — nulling it would silently widen the campaign to the whole org."
uuid template_id FK ""
}
"public.event_approval_tokens" {
uuid event_id FK ""
}
"public.event_connection_intents" {
uuid event_id FK ""
uuid member_id FK ""
text org_id FK ""
uuid registration_id FK ""
}
"public.event_connection_suggestions" {
uuid event_id FK ""
uuid member_a_id FK ""
uuid member_b_id FK ""
text org_id FK ""
}
"public.event_content" {
uuid event_id FK ""
}
"public.event_email_sequences" {
uuid event_id FK ""
uuid id ""
}
"public.event_feedback" {
uuid event_id FK ""
uuid id ""
uuid member_id FK ""
text org_id FK ""
uuid registration_id FK ""
}
"public.event_photos" {
uuid event_id FK ""
text org_id FK ""
}
"public.event_poll_dates" {
uuid event_id FK ""
text org_id FK ""
}
"public.event_promo_codes" {
uuid event_id FK ""
}
"public.event_sessions" {
uuid event_id FK ""
}
"public.event_slug_history" {
uuid event_id FK ""
}
"public.event_speakers" {
uuid event_id FK ""
uuid member_id FK ""
text org_id FK ""
}
"public.event_sponsor_slots" {
uuid event_id FK ""
text org_id FK ""
}
"public.event_staff_assignments" {
uuid contact_id FK "public.contacts is not org-scoped by a single column (source_org_id / primary_org_id only), so a same-org FK guard is not well-defined here the way it is for member_id. No guard added, matching #5313's scope."
uuid event_id FK ""
uuid id ""
uuid member_id FK "KNOWN RESIDUAL, stated not built: no trigger or RLS check confirms the referenced member.org_id matches this row's org_id. A cross-org guard could follow 20260818160000's groups.meeting_location_id precedent; out of scope for #5313 and rated material-not-blocking by the adversarial pass on the first draft."
}
"public.event_testimonial_consents" {
uuid contact_id FK ""
uuid event_id FK ""
uuid feedback_id FK ""
text org_id FK ""
}
"public.journeys" {
uuid event_id FK "#3693/#2214 hard event bind for event-sequence journeys. Soft bind via trigger config remains valid for non-event journeys."
uuid id ""
uuid legacy_sequence_id FK "#3693 optional dual-run link to event_email_sequences during cutover. Null for native journeys."
text org_id FK ""
uuid parent_journey_id FK ""
}
"public.location_bookings" {
uuid booked_for_member_id FK ""
uuid event_id FK ""
uuid location_id FK ""
uuid meeting_id FK ""
}
"public.registration_form_submissions" {
uuid cohort_id FK ""
uuid company_id FK ""
uuid event_id FK ""
uuid form_id FK ""
uuid member_id FK ""
text org_id FK ""
}
"public.seating_tables" {
uuid event_id FK ""
text org_id FK ""
}
"public.signature_event_linked_events" {
uuid chamber_event_id FK ""
uuid signature_event_id FK ""
}
"public.sponsorship_inventory" {
uuid linked_event_id FK ""
text org_id FK ""
}
"public.sponsorship_offerings" {
uuid event_id FK "#3542: NULL = reusable across events (org-level levels, a globally-offered vendor table); set = specific to one chamber_event (e.g. a gala presenting sponsor)."
uuid id ""
text org_id FK ""
}
"public.sponsorships" {
uuid company_id FK ""
uuid event_id FK "#3542: set for an event-scoped sponsorship; NULL for an org-level one."
uuid id ""
uuid member_id FK ""
uuid membership_unit_id FK ""
uuid offering_id FK "#3542: FK to sponsorship_offerings (renamed from tier_id)."
text org_id FK ""
uuid signature_event_id FK ""
uuid subscription_id FK ""
}
"public.value_events" {
uuid company_id FK ""
uuid event_id FK ""
uuid member_id FK ""
text org_id FK ""
uuid related_member_id FK ""
}
"public.video_assets" {
uuid course_id FK ""
uuid event_id FK ""
uuid id ""
}
"public.locations" {
uuid id ""
uuid offered_by_member_id FK ""
text org_id FK ""
}
"public.location_rooms" {
uuid id ""
uuid location_id FK ""
text org_id FK ""
uuid parent_room_id FK "#5307 one-level nesting (a breakout inside a hall). Same org AND same location enforced by trigger; ON DELETE SET NULL so a hard delete never orphans. No cycle guard at v1 — UI nests one level."
}
"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