Added primary key to coupon lookup.
Otherwise REPLACE query adds a multiple identical rows.
This commit is contained in:
parent
db9d6e03e7
commit
a86560498e
|
@ -342,7 +342,7 @@ class WC_Admin_Api_Init {
|
||||||
coupon_id BIGINT UNSIGNED NOT NULL,
|
coupon_id BIGINT UNSIGNED NOT NULL,
|
||||||
date_created timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
date_created timestamp DEFAULT '0000-00-00 00:00:00' NOT NULL,
|
||||||
coupon_gross_discount double DEFAULT 0 NOT NULL,
|
coupon_gross_discount double DEFAULT 0 NOT NULL,
|
||||||
KEY order_id (order_id),
|
PRIMARY KEY (order_id, coupon_id),
|
||||||
KEY coupon_id (coupon_id),
|
KEY coupon_id (coupon_id),
|
||||||
KEY date_created (date_created)
|
KEY date_created (date_created)
|
||||||
) $collate;
|
) $collate;
|
||||||
|
|
Loading…
Reference in New Issue