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)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| gift_card_id | uuid | not null, references gift_cards.id | |
| order_id | uuid | references orders.id | |
| amount_cents | integer | not null | |
| occurred_at | timestamptz | not null |
Indexes (1)
(gift_card_id, occurred_at)
Relationships
gift_card_transactions.gift_card_idreferencesgift_cards.idgift_card_transactions.order_idreferencesorders.id