rate_calendar table
The rate_calendar table in the Hotel Booking Database Schema schema has 8 columns, keyed by id, with 2 foreign keys to room_types and rate_plans.
One row per sellable night. This single table answers both what is free and what it costs, which is why availability search stays fast.
Columns (8)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| room_type_id | uuid | not null, references room_types.id | |
| rate_plan_id | uuid | not null, references rate_plans.id | |
| stay_date | date | not null | |
| rate_cents | integer | not null | |
| rooms_available | smallint | not null | |
| min_stay_nights | smallint | ||
| is_closed | boolean | not null |
Indexes (2)
(room_type_id, rate_plan_id, stay_date)unique(stay_date, is_closed)
Relationships
rate_calendar.room_type_idreferencesroom_types.idrate_calendar.rate_plan_idreferencesrate_plans.id