Skip to content
Venue booking & governance

availability_slots

Recurring weekly availability windows per bookable space. A venue publishes when each space is open for bookings (e.g. "Monday 18:00–23:00"). When slots exist for a space, booking requests are validated against them; when none exist the space is treated as always-available (backward-compat).

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
space_iduuid no—
day_of_weekinteger no—
start_timetext no—
end_timetext no—
is_activeboolean notrue
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

  • (space_id)
    availability_slots_space_idx

Foreign keys

Used by

Code that reads or writes this table, found by static analysis of the tRPC routers and API handlers (including helpers they call).

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
  }
  bookable_spaces ||--o{ availability_slots : "space_id"

Defined at server/database/schema.ts:535 as availabilitySlots.