You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `discount/view` policy is no longer required for the store customers to use a discount and must be removed from all users who are not managing discounts.
370
+
The policy allows to access all the discount details, including the coupon codes to activate them, which could lead to system abuse.
371
+
372
+
To learn more, see the [discounts policies overview](policies.md#discounts).
373
+
374
+
### Database update
375
+
376
+
Run the following scripts:
377
+
378
+
=== "MySQL"
379
+
380
+
``` sql
381
+
CREATE TABLE ibexa_discount_code_usage (
382
+
id INT AUTO_INCREMENT NOT NULL,
383
+
discount_code_id INT NOT NULL,
384
+
order_id INT NOT NULL,
385
+
discriminator VARCHAR(10) NOT NULL,
386
+
used_at DATETIME NOT NULL COMMENT '(DC2Type:datetime_immutable)',
387
+
INDEX ibexa_discount_code_usage_discount_code_idx (discount_code_id),
388
+
INDEX ibexa_discount_code_usage_order_idx (order_id),
389
+
PRIMARY KEY(id)
390
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_520_ci` ENGINE = InnoDB;
391
+
392
+
CREATE TABLE ibexa_discount_code_usage_email (
393
+
id INT NOT NULL,
394
+
user_email VARCHAR(190) DEFAULT NULL,
395
+
INDEX ibexa_discount_code_usage_email_idx (user_email),
396
+
UNIQUE INDEX ibexa_discount_codes_usage_email_uidx (id, user_email),
397
+
PRIMARY KEY(id)
398
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_520_ci` ENGINE = InnoDB;
399
+
400
+
CREATE TABLE ibexa_discount_code_usage_user (
401
+
id INT NOT NULL,
402
+
user_id INT DEFAULT NULL,
403
+
INDEX ibexa_discount_code_usage_user_idx (user_id),
404
+
UNIQUE INDEX ibexa_discount_codes_usage_user_uidx (id, user_id),
405
+
PRIMARY KEY(id)
406
+
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_520_ci` ENGINE = InnoDB;
0 commit comments