Make WordPress Core


Ignore:
Timestamp:
09/15/2013 11:11:30 PM (13 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

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

    r25179 r25448  
    19791979        }
    19801980
    1981         // Upgrade verions prior to 3.7
    1982         if ( $wp_current_db_version < 25179 && is_multisite() && is_main_network() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
    1983                 $wpdb->query( "ALTER TABLE $wpdb->signups ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST" );
    1984                 $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain" );
     1981        // Multisite schema upgrades.
     1982        if ( $wp_current_db_version < 25448 && is_multisite() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) && is_main_network() ) {
     1983
     1984                // Upgrade verions prior to 3.7
     1985                if ( $wp_current_db_version < 25179 ) {
     1986                        // New primary key for signups.
     1987                        $wpdb->query( "ALTER TABLE $wpdb->signups ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST" );
     1988                        $wpdb->query( "ALTER TABLE $wpdb->signups DROP INDEX domain" );
     1989                }
     1990
     1991                if ( $wp_current_db_version < 25448 ) {
     1992                        // Convert archived from enum to tinyint.
     1993                        $wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived varchar(1) NOT NULL default '0'" );
     1994                        $wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived tinyint(2) NOT NULL default 0" );
     1995                }
    19851996        }
    19861997}
Note: See TracChangeset for help on using the changeset viewer.