From c0ad8e700fc18344a706c24d804ab5820b319d73 Mon Sep 17 00:00:00 2001 From: Jake Spurlock Date: Thu, 19 Sep 2019 21:41:35 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@46193 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/upgrade.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index 30abdd46ce..d42673f01a 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/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() ); } /**