Multisite: Remove the redundant blog_versions table.

As part of the Multisite installation process, a `blog_versions` table is created. This table is never read from (except immediately prior to updating it), it's only ever inserted into or updated. It is not used to determine which blogs need to be upgraded.
This table was introduced in 3.0 when the WPMU schema was merged #11644 and it appears the table has never been used in core and is therefore redundant and may as well be removed.

Props johnbillion, nacin, ryan, johnjamesjacoby, whyisjake.

Fixes #19755. See #41685.



git-svn-id: https://develop.svn.wordpress.org/trunk@46194 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jake Spurlock 2019-09-19 22:06:41 +00:00
parent c0ad8e700f
commit a63e490a1e
3 changed files with 0 additions and 23 deletions

View File

@ -261,13 +261,6 @@ CREATE TABLE $wpdb->posts (
KEY domain (domain(50),path(5)),
KEY lang_id (lang_id)
) $charset_collate;
CREATE TABLE $wpdb->blog_versions (
blog_id bigint(20) NOT NULL default '0',
db_version varchar(20) NOT NULL default '',
last_updated datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (blog_id),
KEY db_version (db_version)
) $charset_collate;
CREATE TABLE $wpdb->blogmeta (
meta_id bigint(20) unsigned NOT NULL auto_increment,
blog_id bigint(20) NOT NULL default '0',

View File

@ -650,13 +650,6 @@ if ( ! function_exists( 'wp_upgrade' ) ) :
wp_cache_flush();
if ( is_multisite() ) {
$site_id = get_current_blog_id();
if ( $wpdb->get_row( $wpdb->prepare( "SELECT blog_id FROM {$wpdb->blog_versions} WHERE blog_id = %d", $site_id ) ) ) {
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->blog_versions} SET db_version = %d WHERE blog_id = %d", $wp_db_version, $site_id ) );
} else {
$wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( %d, %d, NOW() );", $site_id, $wp_db_version ) );
}
update_site_meta( get_current_blog_id(), 'db_version', $wp_db_version );
update_site_meta( get_current_blog_id(), 'db_last_updated', microtime() );
}

View File

@ -306,7 +306,6 @@ class wpdb {
'sitemeta',
'sitecategories',
'registration_log',
'blog_versions',
);
/**
@ -425,14 +424,6 @@ class wpdb {
*/
public $blogmeta;
/**
* Multisite Blog Versions table
*
* @since 3.0.0
* @var string
*/
public $blog_versions;
/**
* Multisite Registration Log table
*