mileage_transactions table

The mileage_transactions table in the Airline Reservation Database Schema schema has 8 columns, keyed by id, with 2 foreign keys to frequent_flyer_accounts and tickets.

Signed append-only ledger. miles_balance is the running total and can always be rebuilt from here.

Columns (8)

Columns of the mileage_transactions table
ColumnTypeConstraintsDescription
iduuidprimary key
account_iduuidnot null, references frequent_flyer_accounts.id
ticket_iduuidreferences tickets.id
typemileage_typenot null
milesintegernot null
descriptionvarchar(255)
occurred_attimestamptznot null
expires_ondate

Indexes (1)

  • (account_id, occurred_at)

Relationships