PX_COUPON

This table contains all of the coupons issued to individual customers.

Column Descriptions:

NameTypeDescription
PX_COUPON_IDBIGINT NOT NULLThe primary key of a coupon. This is the coupon ID.
USERS_IDBIGINTForeign key to the USERS table. The identified customer is the owner of this coupon, if the coupon is issued to a registered user.
STOREENT_IDINTEGER NOT NULLForeign key to the STOREENT table. The store entity ID, plus the name, plus the version uniquely identify the promotion for which this coupon is issued.
VERSIONINTEGER NOT NULLThe version of the promotion for which this coupon is issued.
EFFECTIVETIMESTAMP NOT NULLThe date on which this coupon first becomes active.
EXPIRETIMESTAMP NOT NULLThe date when this coupon expires.
STATUSINTEGER NOT NULL DEFAULT 0The current status of this coupon: 0: active 1: cancelled 2: being used in an order but not finalized yet 3: expired 4: deleted The default value is 0.
ORDERS_IDBIGINTForeign key to the ORDERS table. If this coupon is being used in an order, or applied to an order and cancelled, this identifies the order.
GUESTIDVARCHAR (64)This is the token by which this guest user will be recognized next time, if the coupon is issued to a guest user.
NAMEVARCHAR (128) NOT NULLThe name of the promotion for which this coupon is issued.
CODEVARCHAR (128)An optional code to identify this coupon.
OPTCOUNTERSMALLINTThe optimistic concurrency control counter for the table. Every time there is an update to the table, the counter is incremented.

Indexes:

NameColumn NamesType
<SYSTEM-GENERATED>PX_COUPON_IDPrimary Key
I0000389STOREENT_ID+NAME+VERSIONNon-Unique Index
I0000390ORDERS_ID+USERS_IDNon-Unique Index
I0000391ORDERS_ID+GUESTIDNon-Unique Index
I0000404STOREENT_IDNon-Unique Index
I0000405USERS_IDNon-Unique Index
I0000406ORDERS_IDNon-Unique Index

Constrained By Parent Tables:

ConstraintColumnsParent TableParent ColumnsType
F_1052USERS_IDUSERSUSERS_IDCascade
F_1053STOREENT_IDSTOREENTSTOREENT_IDCascade
F_1054ORDERS_IDORDERSORDERS_IDCascade