booking_segments table
The booking_segments table in the Airline Reservation Database Schema schema has 6 columns, keyed by id, with 3 foreign keys to bookings, flights and fare_classes. 8 columns in ticket_coupons, seat_assignments, special_service_requests, ancillary_purchases and 3 more reference it.
The itinerary. segment_order is what turns a set of flights into a journey with connections in the right sequence.
Columns (6)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| booking_id | uuid | not null, references bookings.id | |
| flight_id | uuid | not null, references flights.id | |
| fare_class_id | uuid | not null, references fare_classes.id | |
| segment_order | smallint | not null | |
| status | segment_status | not null |
Indexes (2)
(booking_id, segment_order)unique(flight_id, status)
Relationships
booking_segments.booking_idreferencesbookings.idbooking_segments.flight_idreferencesflights.idbooking_segments.fare_class_idreferencesfare_classes.idticket_coupons.booking_segment_idreferencesbooking_segmentsseat_assignments.booking_segment_idreferencesbooking_segmentsspecial_service_requests.booking_segment_idreferencesbooking_segmentsancillary_purchases.booking_segment_idreferencesbooking_segmentsbaggage.booking_segment_idreferencesbooking_segmentscheck_ins.booking_segment_idreferencesbooking_segmentsrebookings.original_segment_idreferencesbooking_segmentsrebookings.new_segment_idreferencesbooking_segments