$wpdb->
query( 'DROP TABLE IF EXISTS ' .
$wpdb->prefix . 'optiongroup_options'
);
// Update comments table to use comment_type.
$wpdb->
query( "UPDATE
$wpdb->comments SET comment_type='trackback', comment_content = REPLACE(comment_content, '<trackback />', '') WHERE comment_content LIKE '<trackback />%'"
);
$wpdb->
query( "UPDATE
$wpdb->comments SET comment_type='pingback', comment_content = REPLACE(comment_content, '<pingback />', '') WHERE comment_content LIKE '<pingback />%'"
);
// Some versions have multiple duplicate option_name rows with the same values.
$options =
$wpdb->
get_results( "SELECT option_name, COUNT(option_name) AS dupes FROM `
$wpdb->options` GROUP BY option_name"
);
foreach ( $options as $option ) { if ( 1 !=
$option->dupes
) { // Could this be done in the query?
$limit =
$option->dupes - 1;
$dupe_ids =
$wpdb->
get_col( $wpdb->
prepare( "SELECT option_id FROM
$wpdb->options WHERE option_name = %s LIMIT %d",
$option->option_name,
$limit ) );
if ( $dupe_ids ) { $dupe_ids =
implode( ',',
$dupe_ids );
$wpdb->
query( "DELETE FROM
$wpdb->options WHERE option_id IN (
$dupe_ids)"
);
} } } make_site_theme();
}/**
* Execute changes made in WordPress 2.0.
*
* @ignore
* @since 2.0.0
*
* @global wpdb $wpdb WordPress database abstraction object.
* @global int $wp_current_db_version The old (current) database version.
*/