#41685 closed enhancement (fixed)
Save database version in site meta (Multisite)
Reported by: | spacedmonkey | Owned by: | whyisjake |
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 3.0 |
Component: | Networks and Sites | Keywords: | has-patch has-dev-note |
Focuses: | multisite | Cc: |
Description
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.
Attachments (2)
Change History (16)
This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.
7 years ago
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
7 years ago
#4
@
5 years ago
- Keywords has-patch added; needs-patch removed
- Milestone changed from Awaiting Review to 5.3
I think we are ready for this in 5.3.
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
5 years ago
#6
@
5 years ago
- Keywords needs-refresh added
Looks like this patch needs refresh.
Working on this and on unit tests at the DevDay WCEU2019
#7
@
5 years ago
- Keywords needs-refresh removed
Patch
I've refreshed the patch, but looking at it I realized it only updates this info when a db upgrade runs... Isn't it a good idea to add this to the multisite activation somehow to make sure this information is always present? even in a fresh install?
Tests
I was not able to write the tests and would need some help here. Calling wp_upgrade()
does not seem to trigger the actual function in the tests environment. Maybe something to do with the pluggable functions... Or maybe Im just missing somehting... Im not sure...
This is what I was working on for tests (draft code)
/** * @ticket 41685 */ public function test_update_db_info_upon_db_update() { if ( ! is_site_meta_supported() ) { $this->markTestSkipped( 'Tests only runs with the blogmeta database table installed' ); } global $wp_db_version; // force a fake upgrade $wp_db_version ++; wp_upgrade(); $x = get_site_meta( self::$site_id, 'db_version', true ); // check if current site metadata was upgraded... }
#9
@
5 years ago
- Keywords commit added; needs-unit-tests removed
Got confirmation over in #19755 for this approach.
#13
@
5 years ago
Adding needs-dev-notes
tag since I drafted a shared note for this and #19755.
https://make.wordpress.org/core/?p=66113&preview=1&_ppp=ddb7b957d8
Related: #19755 #37923