Skip to content
Venue booking & governance

bookable_spaces

A profile (venue) can offer N bookable areas — e.g. Pinakothek's 5 spaces.

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
profile_iduuid no—
nametext no—
capacityinteger yes—
floor_typetext yes—
price_infotext yes—
descriptiontext yes—
image_urltext yes—
sort_orderinteger yes0
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

None besides the primary key.

Indexes

No secondary indexes.

Foreign keys

  • profile_id → profiles.id
    on delete no action

Referenced by

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
  availability_slots {
    uuid id PK
    uuid space_id FK
  }
  bookable_spaces {
    uuid id PK
    uuid profile_id FK
  }
  booking_requests {
    uuid id PK
    uuid space_id FK
    uuid profile_id FK
    uuid organizer_id FK
    uuid requester_id FK
    uuid moderated_by_id FK
  }
  profiles {
    uuid id PK
    text username UK
  }
  bookable_spaces ||--o{ availability_slots : "space_id"
  profiles ||--o{ bookable_spaces : "profile_id"
  bookable_spaces ||--o{ booking_requests : "space_id"
  profiles ||--o{ booking_requests : "profile_id"
  profiles |o--o{ booking_requests : "organizer_id"

Defined at server/database/schema.ts:477 as bookableSpaces.