gift_card_transactions table

The gift_card_transactions table in the E-commerce Database Schema schema has 5 columns, keyed by id, with 2 foreign keys to gift_cards and orders.

Signed ledger, same shape as inventory_movements. balance_cents is the running total.

Columns (5)

Columns of the gift_card_transactions table
ColumnTypeConstraintsDescription
iduuidprimary key
gift_card_iduuidnot null, references gift_cards.id
order_iduuidreferences orders.id
amount_centsintegernot null
occurred_attimestamptznot null

Indexes (1)

  • (gift_card_id, occurred_at)

Relationships

  • gift_card_transactions.gift_card_id references gift_cards.id
  • gift_card_transactions.order_id references orders.id