Minor fixes in bulk migration logic.

This commit is contained in:
vedanshujain 2022-04-01 18:00:49 +05:30
parent 81f918af87
commit bb10c88b8f
1 changed files with 2 additions and 1 deletions

View File

@ -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