Skip to content
Community engagement

video_votes

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
city_slugtext no—
winner_video_iduuid no—
loser_video_iduuid no—
voter_session_idtext no—
voter_dancer_iduuid yes—
created_attimestamp yesnow()

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

  • (voter_session_id, city_slug)
    video_votes_session_idx

Foreign keys

  • winner_video_id → city_videos.id
    on delete no action
  • loser_video_id → city_videos.id
    on delete no action
  • voter_dancer_id → dancers.id
    on delete no action

Used by

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

REST & webhooks

  • ANY /mcp
  • ANY /mcp/public

Relations

Rendering diagram…

Diagram source
erDiagram
  city_videos {
    uuid id PK
    uuid dancer_id FK
  }
  dancers {
    uuid id PK
    text email UK
    text neon_auth_id UK
    text username UK
  }
  video_votes {
    uuid id PK
    uuid winner_video_id FK
    uuid loser_video_id FK
    uuid voter_dancer_id FK
  }
  dancers |o--o{ city_videos : "dancer_id"
  city_videos ||--o{ video_votes : "winner_video_id"
  city_videos ||--o{ video_votes : "loser_video_id"
  dancers |o--o{ video_votes : "voter_dancer_id"

Defined at server/database/schema.ts:188 as videoVotes.