Skip to content
Events & plans

attendances

Attendances (ADR-008, migration 0044). One row per dancer per event: replaces the festival/event rows of `plan_items` (Going clicks) and `festival_signups` (ticket holders). Status ladder: interested → going → ticket_holder. One visibility setting replaces both `plan_items.share_going` and `festival_signups.roster_visibility`. Default visibility = hidden (opt-in). Phase 4 expand step: this table is created alongside the old tables. New Going clicks dual-write here and to `plan_items`; the old reads stay on `plan_items`/`festival_signups` until the switch step. `order_id` is nullable and has no FK yet (the `orders` table ships in Phase 3 Step 22).

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
event_iduuid no—
dancer_iduuid yes—
buyer_emailtext yes—
statustext
interestedgoingticket_holder
no—
sourcetext
clickfree_passsocial_passstripetickettailorclaim
no"click"
order_iduuid yes—
visibilitytext
hiddenpublic_minimalpublic_full
no"hidden"
partner_statustext
lookingfound
yes—
travel_booked_attimestamp yes—
stay_booked_attimestamp yes—
vacation_booked_attimestamp yes—
checked_in_attimestamp yes—
verified_attimestamp yes—
created_attimestamp yesnow()
updated_attimestamp yesnow()

Value lists come from .$type<'a' | 'b'>() in the schema — enforced in TypeScript only, not by the database.

Keys, constraints & indexes

Unique

  • (event_id, dancer_id) attendances_event_dancer

Indexes

  • (event_id, lower("attendances"."buyer_email"))unique
    attendances_event_email_uidx · where "attendances"."dancer_id" IS NULL
  • (event_id, status)
    attendances_event_status_idx · where "attendances"."visibility" <> 'hidden'
  • (dancer_id)
    attendances_dancer_idx

Foreign keys

  • event_id → events.id
    on delete cascade
  • dancer_id → dancers.id
    on delete cascade

Used by

Code that reads or writes this table, found by static analysis of the tRPC routers and API handlers (including helpers they call).

Relations

Rendering diagram…

Diagram source
erDiagram
  attendances {
    uuid id PK
    uuid event_id FK
    uuid dancer_id FK
  }
  dancers {
    uuid id PK
    text email UK
    text neon_auth_id UK
    text username UK
  }
  events {
    uuid id PK
    uuid host_profile_id FK
    uuid edited_by FK
  }
  events ||--o{ attendances : "event_id"
  dancers |o--o{ attendances : "dancer_id"
  dancers |o--o{ events : "edited_by"

Defined at server/database/schema.ts:764 as attendances.