Skip to content
Profiles & cities

profile_invites

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
tokentext no—
profile_iduuid no—
event_iduuid yes—
created_byuuid yes—
created_attimestamp yesnow()
last_used_attimestamp yes—
statustext
invitedconfirmeddeclinedproposed
no"invited"
responded_attimestamp yes—
programme_okboolean yes—
programme_notetext yes—
posts_ok_attimestamp yes—
messagetext yes—
kindtext
artistvenue
no"artist"
requestjsonb yes—
termsjsonb yes—
alternativetext yes—
outcometext yes—
notified_attimestamp yes—

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

  • (token)unique
    profile_invites_token_uidx
  • (event_id, profile_id)unique
    profile_invites_event_profile_uidx

Foreign keys

  • profile_id → profiles.id
    on delete cascade
  • event_id → events.id
    on delete cascade
  • created_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).

Relations

Rendering diagram…

Diagram source
erDiagram
  dancers {
    uuid id PK
    text email UK
    text neon_auth_id UK
    text username UK
  }
  events {
    uuid id PK
    uuid host_profile_id FK
    uuid edited_by FK
  }
  profile_invites {
    uuid id PK
    uuid profile_id FK
    uuid event_id FK
    uuid created_by FK
  }
  profiles {
    uuid id PK
    text username UK
  }
  profiles |o--o{ events : "host_profile_id"
  dancers |o--o{ events : "edited_by"
  profiles ||--o{ profile_invites : "profile_id"
  events |o--o{ profile_invites : "event_id"
  dancers |o--o{ profile_invites : "created_by"

Defined at server/database/schema.ts:1189 as profileInvites.