ancillary_purchases table
The ancillary_purchases table in the Airline Reservation Database Schema schema has 9 columns, keyed by id, with 4 foreign keys to ancillary_products, bookings, booking_passengers and booking_segments.
Amount is copied from the product at purchase, so a later price change never rewrites what was paid.
Columns (9)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| product_id | uuid | not null, references ancillary_products.id | |
| booking_id | uuid | not null, references bookings.id | |
| booking_passenger_id | uuid | references booking_passengers.id | |
| booking_segment_id | uuid | references booking_segments.id | |
| quantity | smallint | not null | |
| amount_minor | bigint | not null | |
| currency | char(3) | not null | |
| purchased_at | timestamptz | not null |
Indexes (1)
(booking_id)
Relationships
ancillary_purchases.product_idreferencesancillary_products.idancillary_purchases.booking_idreferencesbookings.idancillary_purchases.booking_passenger_idreferencesbooking_passengers.idancillary_purchases.booking_segment_idreferencesbooking_segments.id