Networks and Sites: Save database version in site meta (Multisite)
Currently there is there a table in multisite called blog_versions. All this table stores is the database version as number and the date updated. With plans to add site meta in #37923 this new table should be used. This has a number of benefits, including functions to CRUD these values in the database. Once this data is in the blogmeta, table, the blog_versions table can be removed all together. If require a SQL view can be used blog_versions from data stored in blogmeta. Props spacedmonkey, leogermani. Fixes #41685. See #19755. Built from https://develop.svn.wordpress.org/trunk@46193 git-svn-id: http://core.svn.wordpress.org/trunk@46005 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
3bd9e18930
commit
250eb42802
|
@ -657,6 +657,8 @@ if ( ! function_exists( 'wp_upgrade' ) ) :
|
||||||
} else {
|
} 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 ) );
|
$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() );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.3-alpha-46192';
|
$wp_version = '5.3-alpha-46193';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue