Community engagement
reviews
Reviews & ratings — polymorphic by (targetType, targetSlug) so a review can attach to ANY entity (festival / venue / artist / organizer), including on-demand stubs created by "ask locals" recommendations, without needing a full entity table for each. `source` separates a normal review from an auto-5★ recommendation. One review per dancer per target.
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| target_type | text festivalvenueartistorganizer | no | — | |
| target_slug | text | no | — | |
| target_name | text | yes | — | |
| city_slug | text | yes | — | |
| dancer_id | uuid | no | — | |
| reviewer_name | text | yes | — | |
| reviewer_username | text | yes | — | |
| rating | integer | no | — | |
| text | text | yes | — | |
| source | text reviewrecommendation | no | "review" | |
| status | text visiblehidden | no | "visible" | |
| 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
- (target_type, target_slug, dancer_id) review_target_dancer_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
- 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
}
reviews {
uuid id PK
uuid dancer_id FK
}
dancers ||--o{ reviews : "dancer_id" Defined at server/database/schema.ts:262 as reviews.