Skip to content
Venue booking & governance

booking_inquiries

Booking inquiries (migration 0039): anyone asks to book an artist or venue from their page, no account needed. The page's team answers by email.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
profile_iduuid no—
requester_iduuid yes—
nametext no—
emailtext no—
phonetext yes—
organizationtext yes—
whattext no—
event_datedate yes—
citytext yes—
guestsinteger yes—
budgettext yes—
messagetext no—
statustext
newanswereddeclined
no"new"
notifiedinteger no0
created_attimestamp nonow()
answered_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

  • (profile_id, created_at)
    booking_inquiries_profile_idx
  • (email, created_at)
    booking_inquiries_email_idx

Foreign keys

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

Relations

Rendering diagram…

Diagram source
erDiagram
  booking_inquiries {
    uuid id PK
    uuid profile_id FK
    uuid requester_id FK
  }
  dancers {
    uuid id PK
    text email UK
    text neon_auth_id UK
    text username UK
  }
  profiles {
    uuid id PK
    text username UK
  }
  profiles ||--o{ booking_inquiries : "profile_id"
  dancers |o--o{ booking_inquiries : "requester_id"

Defined at server/database/schema.ts:1267 as bookingInquiries.