Profiles & cities
profile_contacts
People who signed up on a profile's website (RAZ-412, migration 0045): the profile's contacts on WeDance. One row per email per profile; signing up again updates it. Linked to a dancer when the email has a WeDance account.
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| profile_id | uuid | no | — | |
| dancer_id | uuid | yes | — | |
| text | no | — | ||
| name | text | yes | — | |
| phone | text | yes | — | |
| locale | text | yes | — | |
| source | jsonb | no | {} | |
| note | text | yes | — | |
| status | text subscribedunsubscribed | no | "subscribed" | |
| created_at | timestamp | no | now() | |
| updated_at | timestamp | no | now() |
Value lists come from .$type<'a' | 'b'>() in the schema — enforced in TypeScript only, not by the database.
Keys, constraints & indexes
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/contacts/unsubscribe
- ANY /api/profiles/:username/contacts
- 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
}
profile_contacts {
uuid id PK
uuid profile_id FK
uuid dancer_id FK
}
profiles {
uuid id PK
text username UK
}
profiles ||--o{ profile_contacts : "profile_id"
dancers |o--o{ profile_contacts : "dancer_id" Defined at server/database/schema.ts:1305 as profileContacts.