Skip to content
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

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
dancer_iduuid no—
kindtext no—
titletext no—
targettext yes—
period_yearinteger yes—
metadatajsonb yes—
created_attimestamp yesnow()
updated_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

  • (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.