seat_assignments table
The seat_assignments table in the Airline Reservation Database Schema schema has 7 columns, keyed by id, with 3 foreign keys to booking_segments, booking_passengers and seats.
Per segment, not per booking: a connecting journey means a different seat on each leg. The unique key is what stops double-selling 14A.
Columns (7)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| booking_segment_id | uuid | not null, references booking_segments.id | |
| booking_passenger_id | uuid | not null, references booking_passengers.id | |
| seat_id | uuid | not null, references seats.id | |
| is_paid | boolean | not null | |
| amount_minor | bigint | ||
| assigned_at | timestamptz | not null |
Indexes (2)
(booking_segment_id, seat_id)unique(booking_passenger_id)
Relationships
seat_assignments.booking_segment_idreferencesbooking_segments.idseat_assignments.booking_passenger_idreferencesbooking_passengers.idseat_assignments.seat_idreferencesseats.id