Skip to content
Profiles & cities

profile_members

Who manages a profile (hosting mode). Created when an admin approves a claim or when a dancer creates a new profile. `claimed` on the profile mirrors "has at least one owner" so the v3 sync never overwrites it.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
profile_iduuid no—
dancer_iduuid no—
roletext
ownereditormoderator
no"owner"
titletext yes—
added_byuuid yes—
term_startdate yes—
term_enddate yes—
created_attimestamp yesnow()

Value lists come from .$type<'a' | 'b'>() in the schema — enforced in TypeScript only, not by the database.

Keys, constraints & indexes

Unique

  • (profile_id, dancer_id) profile_members_profile_dancer

Indexes

  • (dancer_id)
    profile_members_dancer_idx

Foreign keys

  • profile_id → profiles.id
    on delete cascade
  • dancer_id → dancers.id
    on delete cascade
  • added_by → 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).

tRPC procedures

REST & webhooks

  • 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_members {
    uuid id PK
    uuid profile_id FK
    uuid dancer_id FK
    uuid added_by FK
  }
  profiles {
    uuid id PK
    text username UK
  }
  profiles ||--o{ profile_members : "profile_id"
  dancers ||--o{ profile_members : "dancer_id"
  dancers |o--o{ profile_members : "added_by"

Defined at server/database/schema.ts:388 as profileMembers.