Events & plans
dancer_goals
Dancer goals (ADR-009, migration 0044). Goals were stored as plan_items with item_type='goal' and the goal itself in metadata. Now they have their own table with typed columns.
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| dancer_id | uuid | no | — | |
| kind | text | no | — | |
| title | text | no | — | |
| target | text | yes | — | |
| period_year | integer | yes | — | |
| metadata | jsonb | yes | — | |
| created_at | timestamp | yes | now() | |
| updated_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
- (dancer_id)dancer_goals_dancer_idx
Foreign keys
- dancer_id → dancers.id on delete cascade
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
dancer_goals {
uuid id PK
uuid dancer_id FK
}
dancers {
uuid id PK
text email UK
text neon_auth_id UK
text username UK
}
dancers ||--o{ dancer_goals : "dancer_id" Defined at server/database/schema.ts:814 as dancerGoals.