WordPress.org

Make WordPress Core

Changeset 46193


Ignore:
Timestamp:
09/19/2019 09:41:35 PM (8 weeks ago)
Author:
whyisjake
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/upgrade.php

    r46155 r46193  
    658658                $wpdb->query( $wpdb->prepare( "INSERT INTO {$wpdb->blog_versions} ( `blog_id` , `db_version` , `last_updated` ) VALUES ( %d, %d, NOW() );", $site_id, $wp_db_version ) );
    659659            }
     660            update_site_meta( get_current_blog_id(), 'db_version', $wp_db_version );
     661            update_site_meta( get_current_blog_id(), 'db_last_updated', microtime() );
    660662        }
    661663
Note: See TracChangeset for help on using the changeset viewer.