Community engagement
video_votes
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| city_slug | text | no | — | |
| winner_video_id | uuid | no | — | |
| loser_video_id | uuid | no | — | |
| voter_session_id | text | no | — | |
| voter_dancer_id | uuid | yes | — | |
| created_at | timestamp | yes | now() |
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).
tRPC procedures
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.