PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.0
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.0
1.7.0 1.6.6 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 All 50 releases
← All changes | database/DBMigrator.php +43 -0 1.6.1 → 1.7.0 View file →
@@ -17,8 +17,9 @@
17 17 use FluentCart\Database\Migrations\OrderTransactionsMigrator;
18 18 use FluentCart\Database\Migrations\ProductDetailsMigrator;
19 19 use FluentCart\Database\Migrations\ProductDownloadsMigrator;
20 20 use FluentCart\Database\Migrations\ProductMetaMigrator;
21 +use FluentCart\Database\Migrations\ProductReviewsMigrator;
21 22 use FluentCart\Database\Migrations\ProductVariationMigrator;
22 23 use FluentCart\Database\Migrations\ScheduledActionsMigrator;
23 24 use FluentCart\Database\Migrations\ShippingClassesMigrator;
24 25 use FluentCart\Database\Migrations\SubscriptionMetaMigrator;
@@ -69,8 +70,9 @@
69 70 OrderTransactionsMigrator::class,
70 71 ProductDetailsMigrator::class,
71 72 ProductDownloadsMigrator::class,
72 73 ProductMetaMigrator::class,
74 + ProductReviewsMigrator::class,
73 75 SubscriptionMetaMigrator::class,
74 76 SubscriptionsMigrator::class,
75 77 TaxClassesMigrator::class,
76 78 TaxRatesMigrator::class,
@@ -135,8 +137,10 @@
135 137 }
136 138
137 139 public static function maybeMigrateDBChanges()
138 140 {
141 + self::maybeMigrateCustomerRecoveryIndexes();
142 +
139 143 /*
140 144 * TODO We will remove this after final release
141 145 */
142 146 $currentDBVersion = get_option('_fluent_cart_db_version');
@@ -177,8 +181,15 @@
177 181
178 182 // 2026-07-24
179 183 OrdersMigrator::addUuidIndex();
180 184
185 + // 2026-08-20
186 + ProductMetaMigrator::addObjectMetaIndex();
187 +
188 + // 2026-09-07 — product reviews. A store updating from a release
189 + // without the reviews table gets it created here.
190 + ProductReviewsMigrator::migrate();
191 +
181 192 // let's check the orders table sequence number
182 193 global $wpdb;
183 194
184 195 // Product Meta unique index removal
@@ -592,8 +603,40 @@
592 603 AttributeObjectRelationsMigrator::migrate();
593 604 AttributeTermsMigrator::migrate();
594 605 AttributeSeeder::seed();
595 606
607 + self::releaseMigrationLock();
608 + }
609 + }
610 +
611 + /** Upgrade active stores without running index DDL on customer requests. */
612 + public static function maybeMigrateCustomerRecoveryIndexes(): void
613 + {
614 + $option = '_fluent_cart_customer_recovery_indexes_version';
615 + if (get_option($option) === '1') {
616 + return;
617 + }
618 + if (!(defined('WP_CLI') && WP_CLI) && (!is_admin() || !current_user_can('manage_options'))) {
619 + return;
620 + }
621 + if (!self::acquireMigrationLock()) {
622 + return;
623 + }
624 + try {
625 + if (get_option($option) === '1') {
626 + return;
627 + }
628 + foreach ([SubscriptionsMigrator::class, OrderDownloadPermissionsMigrator::class, CartMigrator::class] as $migrator) {
629 + if (!Schema::hasTable($migrator::$tableName)) {
630 + return;
631 + }
632 + $migrator::addCustomerRecoveryIndex();
633 + if (!$migrator::hasCustomerRecoveryIndex()) {
634 + return; // Keep the upgrade pending if ALTER failed.
635 + }
636 + }
637 + update_option($option, '1', false);
638 + } finally {
596 639 self::releaseMigrationLock();
597 640 }
598 641 }
599 642