Venue booking & governance
bookable_spaces
A profile (venue) can offer N bookable areas — e.g. Pinakothek's 5 spaces.
Columns
| Column | Type | Null | Default | Keys |
|---|---|---|---|---|
| id | uuid | no | gen_random_uuid() | PK |
| profile_id | uuid | no | — | |
| name | text | no | — | |
| capacity | integer | yes | — | |
| floor_type | text | yes | — | |
| price_info | text | yes | — | |
| description | text | yes | — | |
| image_url | text | yes | — | |
| sort_order | integer | yes | 0 | |
| created_at | timestamp | yes | now() |
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
- availability_slots (space_id)
- booking_requests (space_id)
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 /mcp
- ANY /mcp/public
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.