Skip to content
Events & plans

events

Events — dated, public dance events (socials, classes, workshops, festivals). Created outside Drizzle on 2026-07-15 by scripts/migrate/00-schema.mjs to hold the 9,580 historical v4 events (archived=true, hidden). Since 2026-10 it also holds the LIVE upcoming events mirrored from wedance.vip (v3 Firestore) by scripts/sync-v3-events.ts — those carry source='wedance-v3' + source_id=<post id> and archived=false, published=true while still upcoming in v3. Times: start_date / end_date are `timestamp without time zone` holding UTC (the convention 04-events.mjs established). `timezone` is the IANA zone the event happens in — render wall-clock times in it, never in the viewer's zone. Rollback for synced rows: DELETE FROM events WHERE source = 'wedance-v3'.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
slugtext yes—
nametext yes—
typetext yes—
descriptiontext yes""
covertext yes""
start_datetimestamp yes—
end_datetimestamp yes—
is_festivalboolean yesfalse
ticket_urltext yes—
pricetext yes""
citytext yes—
venue_usernametext yes—
organizer_usernametext yes—
stylesjsonb yes[]
archivedboolean notrue
publishedboolean nofalse
source_refjsonb yes—
created_attimestamp yesnow()
sourcetext yes—
source_idtext yes—
city_slugtext yes—
countrytext yes—
timezonetext yes—
venue_nametext yes—
venue_addresstext yes—
venue_latdouble precision yes—
venue_lngdouble precision yes—
organizer_nametext yes—
linktext yes—
series_idtext yes—
artistsjsonb yes[]
synced_attimestamp yes—
updated_attimestamp yesnow()
host_profile_iduuid yes—
agendajsonb no[]
flyer_optionsjsonb no{}
captionjsonb yes—
edited_attimestamp yes—
edited_byuuid yes—
festivaljsonb yes—

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

Keys, constraints & indexes

Unique

None besides the primary key.

Indexes

  • (host_profile_id)
    events_host_profile_idx
  • (slug)unique
    events_slug_uidx · where "events"."slug" IS NOT NULL
  • (archived)
    events_archived_idx
  • (source, source_id)unique
    events_source_uidx · where "events"."source_id" IS NOT NULL
  • (city_slug, start_date)
    events_city_start_idx
  • (venue_username)
    events_venue_username_idx
  • (organizer_username)
    events_organizer_username_idx

Foreign keys

  • host_profile_id → profiles.id
    on delete set null
  • edited_by → dancers.id
    on delete set null

Referenced by

Used by

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

tRPC procedures

REST & webhooks

  • GET /api/event-status
  • GET /api/festivals
  • GET /api/profiles/:username/events
  • GET /api/profiles/:username/site
  • GET /api/qr/:file
  • POST /api/stripe/webhook
  • ANY /mcp
  • ANY /mcp/public

Relations

Rendering diagram…

Diagram source
erDiagram
  ai_usage {
    uuid id PK
    uuid event_id FK
    uuid flyer_id FK
    uuid dancer_id FK
  }
  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
  }
  event_flyers {
    uuid id PK
    uuid event_id FK
    uuid post_id FK
    uuid look_id FK
    uuid created_by FK
  }
  event_posts {
    uuid id PK
    uuid event_id FK
    uuid created_by FK
  }
  events {
    uuid id PK
    uuid host_profile_id FK
    uuid edited_by FK
  }
  giveaway_proposals {
    uuid id PK
    uuid event_id FK
    uuid proposed_by FK
    uuid profile_id FK
    uuid giveaway_id FK
    uuid decided_by FK
  }
  hangouts {
    uuid id PK
    uuid event_id FK
    uuid dancer_id FK
  }
  inbound_requests {
    uuid id PK
    uuid dancer_id FK
    uuid event_id FK
    uuid profile_id FK
    uuid gig_id FK
  }
  profile_invites {
    uuid id PK
    uuid profile_id FK
    uuid event_id FK
    uuid created_by FK
  }
  profile_suggestions {
    uuid id PK
    uuid profile_id FK
    uuid event_id FK
    uuid suggested_by FK
  }
  profiles {
    uuid id PK
    text username UK
  }
  tracked_links {
    uuid id PK
    text code UK
    uuid event_id FK
    uuid profile_id FK
    uuid created_by FK
  }
  events |o--o{ ai_usage : "event_id"
  event_flyers |o--o{ ai_usage : "flyer_id"
  dancers |o--o{ ai_usage : "dancer_id"
  events ||--o{ attendances : "event_id"
  dancers |o--o{ attendances : "dancer_id"
  events ||--o{ event_flyers : "event_id"
  event_posts |o--o{ event_flyers : "post_id"
  dancers |o--o{ event_flyers : "created_by"
  events ||--o{ event_posts : "event_id"
  dancers |o--o{ event_posts : "created_by"
  profiles |o--o{ events : "host_profile_id"
  dancers |o--o{ events : "edited_by"
  events ||--o{ giveaway_proposals : "event_id"
  dancers |o--o{ giveaway_proposals : "proposed_by"
  profiles ||--o{ giveaway_proposals : "profile_id"
  dancers |o--o{ giveaway_proposals : "decided_by"
  events |o--o{ hangouts : "event_id"
  dancers ||--o{ hangouts : "dancer_id"
  dancers |o--o{ inbound_requests : "dancer_id"
  events |o--o{ inbound_requests : "event_id"
  profiles |o--o{ inbound_requests : "profile_id"
  profiles ||--o{ profile_invites : "profile_id"
  events |o--o{ profile_invites : "event_id"
  dancers |o--o{ profile_invites : "created_by"
  profiles ||--o{ profile_suggestions : "profile_id"
  events |o--o{ profile_suggestions : "event_id"
  dancers |o--o{ profile_suggestions : "suggested_by"
  events ||--o{ tracked_links : "event_id"
  profiles ||--o{ tracked_links : "profile_id"
  dancers |o--o{ tracked_links : "created_by"

Defined at server/database/schema.ts:850 as events.