WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 3 months ago

#19755 reopened enhancement

Redundant blog_versions table

Reported by: johnbillion Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 3.0
Component: Multisite Keywords: has-patch dev-feedback needs-testing
Focuses: multisite Cc:

Description

As part of the Multisite installation process, a blog_versions table is created. This table is never read from (except immediately prior to updating it), it's only ever inserted into or updated. It is not used to determine which blogs need to be upgraded.

This table was introduced in 3.0 when the WPMU schema was merged (#11644) and it appears the table has never been used in core and is therefore redundant and may as well be removed.

Attachments (2)

19755.patch (2.9 KB) - added by johnbillion 5 years ago.
19755.2.patch (2.3 KB) - added by spacedmonkey 4 months ago.

Download all attachments as: .zip

Change History (15)

@johnbillion
5 years ago

#1 @johnbillion
5 years ago

  • Keywords has-patch dev-feedback added

Patch just in case, and because I've not done a patch which changes the DB schema before. Hopefully it's all present and correct.

#2 @ryan
5 years ago

I believe wordpress.com and some other big multisite hosts use it for managing upgrades. That's not necessarily a reason the keep the table, but core might someday find blog_versions valuable if we ever improve the currently very lame network upgrade process.

#3 @nacin
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to maybelater
  • Status changed from new to closed

That's not necessarily a reason the keep the table, but core might someday find blog_versions valuable if we ever improve the currently very lame network upgrade process.

Agreed.

#4 @nacin
5 years ago

  • Component changed from Database to Multisite

#5 @spacedmonkey
4 months ago

  • Keywords needs-refresh added
  • Resolution maybelater deleted
  • Status changed from closed to reopened

I think a better way forward for blog_versions table is to not create it on new WordPress installs. Then put a checks in place for the one place in core that writes to the table to check if the table exists before writing to it. This also means that if you have an existing site that you want to get rid of this table, then you can manually delete it.

This is a nice solution as it is backwards compatible but also means you can removed blog_versions if you want as well.

This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.


4 months ago

#7 @johnjamesjacoby
4 months ago

See also #37923.

Imagine that global wp_blogmeta table, and this feature being saved there, with a db_version meta_key and that same numeric value.

#8 @SergeyBiryukov
4 months ago

  • Milestone set to Awaiting Review

#9 @spacedmonkey
4 months ago

  • Focuses multisite added
  • Keywords needs-testing added; needs-refresh removed

I updated the patch for this. The new patch is very simple.

  • Don't create table on new sites installs
  • Check to see if table exists before writing to it.

This needs testing. Both creating a new site, an existing site with the table and with the table manually removed.

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


4 months ago

This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.


3 months ago

This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.


3 months ago

This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.


3 months ago

Note: See TracTickets for help on using tickets.