Added primary key to coupon lookup.

Otherwise REPLACE query adds a multiple identical rows.
This commit is contained in:
Peter Fabian 2018-11-23 22:29:47 +01:00
parent db9d6e03e7
commit a86560498e
1 changed files with 1 additions and 1 deletions

View File

@ -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;