Remove deletion of zero parent refunds from the migration

This commit is contained in:
Nestor Soriano 2023-05-26 10:42:11 +02:00
parent 34a8de217c
commit bb6645d4ac
No known key found for this signature in database
GPG Key ID: 08110F3518C12CAD
1 changed files with 2 additions and 19 deletions

View File

@ -2592,11 +2592,8 @@ function wc_update_770_remove_multichannel_marketing_feature_options() {
}
/**
* Delete stray order records in both posts table and the orders table:
*
* - Posts of type "shop_order_placeholder" with no matching order in the orders table.
* - Records of type "shop_order_refund" with a zero parent order id in both tables.
*
* Delete posts of type "shop_order_placeholder" with no matching order in the orders table.
*
* @return void
*/
function wc_update_780_delete_stray_order_records() {
@ -2617,20 +2614,6 @@ function wc_update_780_delete_stray_order_records() {
)
);
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$wpdb->posts} WHERE post_type = %s AND post_parent = 0",
'shop_order_refund'
)
);
$wpdb->query(
$wpdb->prepare(
"DELETE FROM {$orders_table_name} WHERE type = %s AND (parent_order_id = 0 OR parent_order_id is null)",
'shop_order_refund'
)
);
// phpcs:enable WordPress.DB.PreparedSQL
}