|
@@ 338-342 (lines=5) @@
|
| 335 |
|
/** |
| 336 |
|
* Before updating with DBDELTA, remove any primary keys which could be modified due to schema updates. |
| 337 |
|
*/ |
| 338 |
|
if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}woocommerce_downloadable_product_permissions';" ) ) { |
| 339 |
|
if ( ! $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}woocommerce_downloadable_product_permissions` LIKE 'permission_id';" ) ) { |
| 340 |
|
$wpdb->query( "ALTER TABLE {$wpdb->prefix}woocommerce_downloadable_product_permissions DROP PRIMARY KEY, ADD `permission_id` bigint(20) NOT NULL PRIMARY KEY AUTO_INCREMENT;" ); |
| 341 |
|
} |
| 342 |
|
} |
| 343 |
|
|
| 344 |
|
if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}woocommerce_tax_rate_locations';" ) ) { |
| 345 |
|
if ( $wpdb->get_var( "SHOW INDEX FROM `{$wpdb->prefix}woocommerce_tax_rate_locations` WHERE Key_name LIKE 'location_type_code';" ) ) { |
|
@@ 344-348 (lines=5) @@
|
| 341 |
|
} |
| 342 |
|
} |
| 343 |
|
|
| 344 |
|
if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}woocommerce_tax_rate_locations';" ) ) { |
| 345 |
|
if ( $wpdb->get_var( "SHOW INDEX FROM `{$wpdb->prefix}woocommerce_tax_rate_locations` WHERE Key_name LIKE 'location_type_code';" ) ) { |
| 346 |
|
$wpdb->query( "DROP INDEX `location_type_code` ON {$wpdb->prefix}woocommerce_tax_rate_locations;" ); |
| 347 |
|
} |
| 348 |
|
} |
| 349 |
|
|
| 350 |
|
dbDelta( self::get_schema() ); |
| 351 |
|
} |