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

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
profile_iduuid no—
dancer_iduuid yes—
emailtext no—
nametext yes—
phonetext yes—
localetext yes—
sourcejsonb no{}
notetext yes—
statustext
subscribedunsubscribed
no"subscribed"
created_attimestamp nonow()
updated_attimestamp nonow()

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

  • (profile_id, lower("profile_contacts"."email"))unique
    profile_contacts_profile_email_uidx
  • (profile_id, created_at)
    profile_contacts_profile_idx

Foreign keys

  • profile_id → profiles.id
    on delete cascade
  • dancer_id → dancers.id
    on delete set null

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.