Multisite blogs table: Convert the archived field from enum to tinyint to match the other status fields. fixes #12832.

git-svn-id: https://develop.svn.wordpress.org/trunk@25448 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-09-15 23:11:30 +00:00
parent 3ec962dd56
commit 1d80307d5d
3 changed files with 17 additions and 6 deletions

View File

@ -230,7 +230,7 @@ CREATE TABLE $wpdb->posts (
registered datetime NOT NULL default '0000-00-00 00:00:00', registered datetime NOT NULL default '0000-00-00 00:00:00',
last_updated datetime NOT NULL default '0000-00-00 00:00:00', last_updated datetime NOT NULL default '0000-00-00 00:00:00',
public tinyint(2) NOT NULL default '1', public tinyint(2) NOT NULL default '1',
archived enum('0','1') NOT NULL default '0', archived tinyint(2) NOT NULL default '0',
mature tinyint(2) NOT NULL default '0', mature tinyint(2) NOT NULL default '0',
spam tinyint(2) NOT NULL default '0', spam tinyint(2) NOT NULL default '0',
deleted tinyint(2) NOT NULL default '0', deleted tinyint(2) NOT NULL default '0',

View File

@ -1978,11 +1978,22 @@ function pre_schema_upgrade() {
$wpdb->query("ALTER TABLE $wpdb->options DROP INDEX option_name"); $wpdb->query("ALTER TABLE $wpdb->options DROP INDEX option_name");
} }
// Multisite schema upgrades.
if ( $wp_current_db_version < 25448 && is_multisite() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && is_main_network() ) {
// Upgrade verions prior to 3.7 // Upgrade verions prior to 3.7
if ( $wp_current_db_version < 25179 && is_multisite() && is_main_network() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) { if ( $wp_current_db_version < 25179 ) {
// New primary key for signups.
$wpdb->query( "ALTER TABLE $wpdb->signups ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST" ); $wpdb->query( "ALTER TABLE $wpdb->signups ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST" );
$wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain" ); $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain" );
} }
if ( $wp_current_db_version < 25448 ) {
// Convert archived from enum to tinyint.
$wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived varchar(1) NOT NULL default '0'" );
$wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived tinyint(2) NOT NULL default 0" );
}
}
} }
/** /**

View File

@ -11,7 +11,7 @@ $wp_version = '3.7-alpha-25343';
* *
* @global int $wp_db_version * @global int $wp_db_version
*/ */
$wp_db_version = 25416; $wp_db_version = 25448;
/** /**
* Holds the TinyMCE version * Holds the TinyMCE version