Profiles & cities
follows
Follows — unified follow graph (ADR-004, Step 15). A dancer follows either a professional profile (venue/artist/organizer) OR another dancer. Exactly one of profile_id / target_dancer_id is set per row. Renamed from `artist_follows` (migration 0044). Mutual dancer→dancer follows = friends.
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| dancer_id | uuid | no | — | |
| profile_id | uuid | yes | — | |
| target_dancer_id | uuid | yes | — | |
| 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
- (dancer_id, profile_id) follows_dancer_profile
- (dancer_id, target_dancer_id) follows_dancer_dancer
Indexes
- (profile_id)follows_profile_idx
- (target_dancer_id)follows_target_dancer_idx
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
dancers {
uuid id PK
text email UK
text neon_auth_id UK
text username UK
}
follows {
uuid id PK
uuid dancer_id FK
uuid profile_id FK
uuid target_dancer_id FK
}
profiles {
uuid id PK
text username UK
}
dancers ||--o{ follows : "dancer_id"
profiles |o--o{ follows : "profile_id"
dancers |o--o{ follows : "target_dancer_id" Defined at server/database/schema.ts:973 as follows.