Skip to content
Profiles & cities

profile_affiliations

Step 14 (ADR-004): artist ↔ organiser affiliations ("teaches at", "resident DJ at", "member of"). Links an artist profile to an organiser/venue profile.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
artist_profile_iduuid no—
organizer_profile_iduuid no—
kindtext
teaches_atresidentmember
no—
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

  • (artist_profile_id, organizer_profile_id) profile_affiliations_pair

Indexes

  • (organizer_profile_id)
    profile_affiliations_organizer_idx

Foreign keys

  • artist_profile_id → profiles.id
    on delete cascade
  • organizer_profile_id → profiles.id
    on delete cascade

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

No public or signed-in procedure.

REST & webhooks

None.

Relations

Rendering diagram…

Diagram source
erDiagram
  profile_affiliations {
    uuid id PK
    uuid artist_profile_id FK
    uuid organizer_profile_id FK
  }
  profiles {
    uuid id PK
    text username UK
  }
  profiles ||--o{ profile_affiliations : "artist_profile_id"
  profiles ||--o{ profile_affiliations : "organizer_profile_id"

Defined at server/database/schema.ts:450 as profileAffiliations.