wc_update_360_downloadable_product_permissions_index()
Add new user_order_remaining_expires to speed up user download permission fetching.
Description Description
Return Return
(void)
Source Source
File: includes/wc-update-functions.php
function wc_update_360_downloadable_product_permissions_index() {
global $wpdb;
$index_exists = $wpdb->get_row( "SHOW INDEX FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE key_name = 'user_order_remaining_expires'" );
if ( is_null( $index_exists ) ) {
$wpdb->query( "ALTER TABLE {$wpdb->prefix}woocommerce_downloadable_product_permissions ADD INDEX user_order_remaining_expires (user_id,order_id,downloads_remaining,access_expires)" );
}
}