Profiles & cities
handles
Handle registry (ADR-004, Step 12). One namespace for dancer and profile URLs: `/@<handle>` resolves through this table. citext for case-insensitive uniqueness. Exactly one of dancer_id / profile_id is set.
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| handle | text | no | — | PK |
| dancer_id | uuid | yes | — | unique → dancers.id |
| profile_id | uuid | yes | — | unique → profiles.id |
| 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
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
No public or signed-in procedure.
REST & webhooks
None.
Relations
Rendering diagram…
Diagram source
erDiagram
dancers {
uuid id PK
text email UK
text neon_auth_id UK
text username UK
}
handles {
text handle PK
uuid dancer_id FK,UK
uuid profile_id FK,UK
}
profiles {
uuid id PK
text username UK
}
dancers |o--o{ handles : "dancer_id"
profiles |o--o{ handles : "profile_id" Defined at server/database/schema.ts:9 as handles.