PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.6.5
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.6.5
1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 1.3.20 1.3.19 trunk All 48 releases
← All changes | database/Migrations/OrderTaxRateMigrator.php +9 -1 1.5.0 → 1.6.5 View file →
@@ -10,9 +10,9 @@
10 10 public static function getSqlSchema(): string
11 11 {
12 12 return "`id` BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
13 13 `order_id` BIGINT(20) UNSIGNED NOT NULL,
14 - `tax_rate_id` BIGINT(20) UNSIGNED NOT NULL,
14 + `tax_rate_id` BIGINT(20) NOT NULL,
15 15 `shipping_tax` BIGINT NULL,
16 16 `order_tax` BIGINT NULL,
17 17 `total_tax` BIGINT NULL,
18 18 `meta` json DEFAULT NULL,
@@ -24,10 +24,18 @@
24 24 public static function migrated()
25 25 {
26 26 static::addMetaColumn();
27 27 static::addFiledAtColumn();
28 + static::allowVirtualTaxRateIds();
28 29 static::deduplicateOrderTaxRates();
29 30 static::addOrderTaxRateUniqueIndex();
31 + }
32 +
33 + public static function allowVirtualTaxRateIds()
34 + {
35 + // EU VAT registration rates are virtual and use negative IDs. Keep zero
36 + // reserved for the no-tax sentinel while allowing those rows to persist.
37 + static::modifyColumnIfExists('tax_rate_id', 'BIGINT(20) NOT NULL');
30 38 }
31 39
32 40 public static function deduplicateOrderTaxRates()
33 41 {