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
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| slug | text | yes | — | |
| name | text | yes | — | |
| type | text | yes | — | |
| description | text | yes | "" | |
| cover | text | yes | "" | |
| start_date | timestamp | yes | — | |
| end_date | timestamp | yes | — | |
| is_festival | boolean | yes | false | |
| ticket_url | text | yes | — | |
| price | text | yes | "" | |
| city | text | yes | — | |
| venue_username | text | yes | — | |
| organizer_username | text | yes | — | |
| styles | jsonb | yes | [] | |
| archived | boolean | no | true | |
| published | boolean | no | false | |
| source_ref | jsonb | yes | — | |
| created_at | timestamp | yes | now() | |
| source | text | yes | — | |
| source_id | text | yes | — | |
| city_slug | text | yes | — | |
| country | text | yes | — | |
| timezone | text | yes | — | |
| venue_name | text | yes | — | |
| venue_address | text | yes | — | |
| venue_lat | double precision | yes | — | |
| venue_lng | double precision | yes | — | |
| organizer_name | text | yes | — | |
| link | text | yes | — | |
| series_id | text | yes | — | |
| artists | jsonb | yes | [] | |
| synced_at | timestamp | yes | — | |
| updated_at | timestamp | yes | now() | |
| host_profile_id | uuid | yes | — | |
| agenda | jsonb | no | [] | |
| flyer_options | jsonb | no | {} | |
| caption | jsonb | yes | — | |
| edited_at | timestamp | yes | — | |
| edited_by | uuid | yes | — | |
| festival | jsonb | 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)uniqueevents_slug_uidx · where "events"."slug" IS NOT NULL
- (archived)events_archived_idx
- (source, source_id)uniqueevents_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
Referenced by
- ai_usage (event_id)
- attendances (event_id)
- event_flyers (event_id)
- event_posts (event_id)
- giveaway_proposals (event_id)
- hangouts (event_id)
- inbound_requests (event_id)
- profile_invites (event_id)
- profile_suggestions (event_id)
- tracked_links (event_id)
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
- festivalSignup.join
- giveaway.propose
- giveaway.proposals
- giveaway.decideProposal
- hangouts.listTonight
- hangouts.eventOptions
- hangouts.create
- events.byCity
- events.sameDays
- events.stats
- events.byProfile
- events.get
- events.festivals
- events.festival
- plan.add
- plan.remove
- plan.discover
- plan.weekSocials
- plan.myCourses
- plan.proofShowcase
- referral.myLink
- referral.myResults
- referral.eventLinkResults
- referral.promoterDashboard
- referral.promoKit
- rideShare.create
- business.update
- businessEvents.list
- businessEvents.canEdit
- businessEvents.get
- businessEvents.create
- businessEvents.update
- businessEvents.duplicate
- businessEvents.createSeries
- businessEvents.series
- businessEvents.publishSeries
- businessEvents.attendees
- businessEvents.restore
- businessEvents.archive
- businessEvents.venueIdeas
- businessEvents.inbox
- businessFlyers.caption
- businessFlyers.writeCaption
- businessFlyers.saveCaption
- businessFlyers.state
- businessFlyers.readLook
- businessFlyers.make
- businessFlyers.directions
- businessFlyers.stop
- businessFlyers.again
- businessFlyers.feed
- businessFlyers.fix
- businessFlyers.refresh
- businessFlyers.batch
- businessFlyers.keep
- artistInvites.suggest
- artistInvites.pending
- artistInvites.profile
- artistInvites.saveProfile
- artistInvites.link
- artistInvites.notify
- artistInvites.get
- venueAsks.ask
- venueAsks.list
- venueAsks.book
- venueAsks.unbook
- inquiries.me
- inquiries.addToEvent
- businessPosts.list
- businessPosts.writeCaption
- businessPosts.saveCaption
- businessPosts.writeCaptions
- businessPosts.propose
- businessPosts.add
- businessPosts.update
- businessPosts.remove
- businessLooks.list
- businessLooks.create
- businessLooks.read
- businessLooks.generate
- roommate.toggle
- attendance.set
- attendance.proofShowcase
- attendance.checkIn
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.