From 250eb4280251a6c49fe72a0e9a1699d0012ff2a8 Mon Sep 17 00:00:00 2001 From: whyisjake Date: Thu, 19 Sep 2019 21:42:58 +0000 Subject: [PATCH] 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 --- wp-admin/includes/upgrade.php | 2 ++ wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 30abdd46ce..d42673f01a 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -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() ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 4f26adae55..a459c4e942 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @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.