WordPress at a glance
function is not described

wc_update_310_downloadable_products() WC 1.0

Add an index to the downloadable product permissions table to improve performance of update_user_by_order_id.

No Hooks.

Return

Null. Nothing.

Usage

wc_update_310_downloadable_products();

Code of wc_update_310_downloadable_products() WC 5.0.0

<?php
function wc_update_310_downloadable_products() {
	global $wpdb;

	$index_exists = $wpdb->get_row( "SHOW INDEX FROM {$wpdb->prefix}woocommerce_downloadable_product_permissions WHERE column_name = 'order_id' and key_name = 'order_id'" );

	if ( is_null( $index_exists ) ) {
		$wpdb->query( "ALTER TABLE {$wpdb->prefix}woocommerce_downloadable_product_permissions ADD INDEX order_id (order_id)" );
	}
}