reviews table
The reviews table in the Hotel Booking Database Schema schema has 12 columns, keyed by id, with 3 foreign keys to bookings, properties and guests.
Unique on booking_id, so only a real completed stay can leave a review. That is the whole anti-fake-review mechanism.
Columns (12)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| booking_id | uuid | unique, not null, references bookings.id | |
| property_id | uuid | not null, references properties.id | |
| guest_id | uuid | not null, references guests.id | |
| overall_rating | smallint | not null | |
| cleanliness_rating | smallint | ||
| location_rating | smallint | ||
| value_rating | smallint | ||
| title | varchar(160) | ||
| body | text | ||
| status | review_status | not null | |
| created_at | timestamptz | not null |
Indexes (1)
(property_id, status)
Relationships
reviews.booking_idreferencesbookings.idreviews.property_idreferencesproperties.idreviews.guest_idreferencesguests.id