tickets table
The tickets table in the Airline Reservation Database Schema schema has 12 columns, keyed by id, with 4 foreign keys to bookings, booking_passengers, fares and tickets. 3 columns in mileage_transactions, ticket_coupons and refunds reference it.
The financial document, one per passenger. The 13-digit number is what settles between airlines. A reissue is a NEW ticket pointing at the old one.
Columns (12)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| booking_id | uuid | not null, references bookings.id | |
| booking_passenger_id | uuid | not null, references booking_passengers.id | |
| ticket_number | varchar(14) | unique, not null | |
| status | ticket_status | not null | |
| fare_id | uuid | references fares.id | |
| base_amount_minor | bigint | not null | |
| tax_amount_minor | bigint | not null | |
| total_amount_minor | bigint | not null | |
| currency | char(3) | not null | |
| reissued_from_ticket_id | uuid | references tickets.id | |
| issued_at | timestamptz | not null |
Indexes (2)
(booking_id)(status, issued_at)
Relationships
tickets.booking_idreferencesbookings.idtickets.booking_passenger_idreferencesbooking_passengers.idtickets.fare_idreferencesfares.idtickets.reissued_from_ticket_idreferencestickets.idmileage_transactions.ticket_idreferencesticketsticket_coupons.ticket_idreferencesticketsrefunds.ticket_idreferencestickets