Identity & auth
sessions
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| dancer_id | uuid | no | — | |
| token | text | no | — | unique |
| created_at | timestamp | yes | now() | |
| expires_at | timestamp | no | — |
Value lists come from .$type<'a' | 'b'>() in the schema — enforced in TypeScript only, not by the database.
Keys, constraints & indexes
Unique
- (token) sessions_token_unique
Indexes
No secondary indexes.
Foreign keys
- 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
- GET /api/architecture/admin
- ANY /mcp
- ANY /mcp/public
Relations
Rendering diagram…
Diagram source
erDiagram
dancers {
uuid id PK
text email UK
text neon_auth_id UK
text username UK
}
sessions {
uuid id PK
uuid dancer_id FK
text token UK
}
dancers ||--o{ sessions : "dancer_id" Defined at server/database/schema.ts:69 as sessions.