From bb10c88b8f874f9dfde8194882b98a87b4f02532 Mon Sep 17 00:00:00 2001 From: vedanshujain Date: Fri, 1 Apr 2022 18:00:49 +0530 Subject: [PATCH] Minor fixes in bulk migration logic. --- .../Migrations/CustomOrderTable/WPPostToCOTMigrator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/WPPostToCOTMigrator.php b/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/WPPostToCOTMigrator.php index a21e0126eae..a9ddb9b313b 100644 --- a/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/WPPostToCOTMigrator.php +++ b/plugins/woocommerce/src/Database/Migrations/CustomOrderTable/WPPostToCOTMigrator.php @@ -135,6 +135,7 @@ class WPPostToCOTMigrator { $this->process_migration_for_ids( $order_post_ids ); $last_post_migrated = max( $order_post_ids ); $this->update_checkpoint( $last_post_migrated ); + return false; } /** @@ -192,7 +193,7 @@ class WPPostToCOTMigrator { $checkpoint = $this->get_checkpoint(); $post_ids = $wpdb->get_col( $wpdb->prepare( - "SELECT ID FROM $wpdb->posts WHERE ID > %d AND post_type = %s LIMIT %d", + "SELECT ID FROM $wpdb->posts WHERE ID > %d AND post_type = %s ORDER BY ID ASC LIMIT %d ", $checkpoint['id'], 'shop_order', $batch_size