discounts table
The discounts table in the E-commerce Database Schema schema has 11 columns, keyed by id. 1 column in discount_redemptions references it.
value is a percentage for percentage type, otherwise minor units. currency only applies to fixed-amount discounts.
Columns (11)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| code | varchar(40) | unique, not null | |
| type | discount_type | not null | |
| value | integer | not null | |
| currency | char(3) | ||
| minimum_spend_cents | integer | ||
| usage_limit | integer | ||
| used_count | integer | not null | |
| starts_at | timestamptz | ||
| ends_at | timestamptz | ||
| is_active | boolean | not null |
Relationships
discount_redemptions.discount_idreferencesdiscounts