maiven gateway · online··
manifest · 1d ago
Sign in
Back to catalog
MAIVENsourceraw_postgres

order_promotions

source

Which promo was applied to which order, and for how much.

Definition

The order ↔ promotion bridge with the actual money taken off (`discount_amount`). Computed from the promotion's type+value at apply-time, so historical discounts remain stable even when the catalog row changes.

5 of 5
Column
Description
Tests · PII
order_promotion_id
Primary key — BIGSERIAL.
2 tests
order_id
FK to `orders.order_id`. NOT NULL. ON DELETE CASCADE.
promotion_id
FK to `promotions.promotion_id`. NOT NULL.
1 test
discount_amount
Money taken off this order. NUMERIC(12,2). Non-negative.
applied_at
When the promo was applied. TIMESTAMPTZ.