frequent_flyer_accounts table
The frequent_flyer_accounts table in the Airline Reservation Database Schema schema has 8 columns, keyed by id, with 1 foreign key to passengers. 1 column in mileage_transactions references it.
miles_balance is spendable; qualifying_miles drives tier and resets annually. Conflating the two is the classic loyalty-programme bug.
Columns (8)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| passenger_id | uuid | unique, not null, references passengers.id | |
| membership_number | varchar(20) | unique, not null | |
| tier | loyalty_tier | not null | |
| miles_balance | integer | not null | |
| qualifying_miles | integer | not null | |
| tier_expires_on | date | ||
| enrolled_at | timestamptz | not null |
Indexes (1)
(tier, qualifying_miles)
Relationships
frequent_flyer_accounts.passenger_idreferencespassengers.idmileage_transactions.account_idreferencesfrequent_flyer_accounts