Handle range conversion during update

Closes #11403
This commit is contained in:
Mike Jolley 2016-07-19 16:16:26 +01:00
parent 35c5a29cc2
commit bf93f747c2
1 changed files with 4 additions and 0 deletions

View File

@ -885,6 +885,7 @@ function wc_update_260_zone_methods() {
*/
if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}woocommerce_shipping_zone_shipping_methods';" ) ) {
$old_methods = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}woocommerce_shipping_zone_shipping_methods;" );
if ( $old_methods ) {
$max_new_id = $wpdb->get_var( "SELECT MAX(instance_id) FROM {$wpdb->prefix}woocommerce_shipping_zone_methods" );
$max_old_id = $wpdb->get_var( "SELECT MAX(shipping_method_id) FROM {$wpdb->prefix}woocommerce_shipping_zone_shipping_methods" );
@ -947,6 +948,9 @@ function wc_update_260_zone_methods() {
do_action( 'woocommerce_updated_instance_ids', $changes );
}
}
// Change ranges used to ...
$wpdb->query( "UPDATE {$wpdb->prefix}woocommerce_shipping_zone_locations SET location_code = REPLACE( location_code, '-', '...' );" );
}
function wc_update_260_refunds() {