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.



git-svn-id: https://develop.svn.wordpress.org/trunk@46193 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jake Spurlock 2019-09-19 21:41:35 +00:00
parent dd330aee33
commit c0ad8e700f

View File

@ -657,6 +657,8 @@ if ( ! function_exists( 'wp_upgrade' ) ) :
} 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() );
}
/**