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/SubscriptionsMigrator.php +14 -1 1.6.3 → 1.6.5 View file →
@@ -8,8 +8,10 @@
8 8
9 9 public static string $tableName = "fct_subscriptions";
10 10
11 11
12 + const CUSTOMER_RECOVERY_INDEX = 'idx_subscriptions_customer_recovery';
13 +
12 14 public static function getSqlSchema(): string
13 15 {
14 16 $indexPrefix = static::getDbPrefix() . 'fct_index_';
15 17
@@ -49,13 +51,15 @@
49 51
50 52 INDEX `{$indexPrefix}_order_subscription_idx` (`parent_order_id` ASC),
51 53 INDEX `{$indexPrefix}vendor_subscription_id_idx` (`vendor_subscription_id` ASC),
52 54 INDEX `{$indexPrefix}_expiry_scan_idx` (`status`, `next_billing_date`, `id`),
53 - INDEX `{$indexPrefix}collection_method_idx` (`collection_method`)";
55 + INDEX `{$indexPrefix}collection_method_idx` (`collection_method`),
56 + INDEX `" . self::CUSTOMER_RECOVERY_INDEX . "` (`customer_id` ASC, `id` ASC)";
54 57 }
55 58
56 59 public static function migrated()
57 60 {
61 + static::addCustomerRecoveryIndex();
58 62 static::addUuidColumn();
59 63 static::renameInitialAmountToSignupFee();
60 64 static::backfillEmptyUuids();
61 65 static::addVendorSubscriptionIdIndex();
@@ -127,6 +131,15 @@
127 131 }
128 132
129 133 (new Subscription())->batchUpdate($uuids);
130 134 } while ($subscriptions->count() >= $chunkSize);
135 + }
136 + public static function addCustomerRecoveryIndex(): void
137 + {
138 + static::addIndexIfNotExists(self::CUSTOMER_RECOVERY_INDEX, ['customer_id', 'id']);
139 + }
140 +
141 + public static function hasCustomerRecoveryIndex(): bool
142 + {
143 + return static::hasIndex(self::CUSTOMER_RECOVERY_INDEX);
131 144 }
132 145 }