From 086f2b9dbdf653d8ec0dbf8bbf7b8ed2519b87e9 Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Sat, 1 Nov 2014 01:10:04 +0000 Subject: [PATCH] Fix database schema update introduced in [30121]. The index must be manually dropped before `dbDelta()` can add the new index without throwing a notice. Fixes #22023. git-svn-id: https://develop.svn.wordpress.org/trunk@30134 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/upgrade.php | 20 +++++--------------- src/wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/wp-admin/includes/upgrade.php b/src/wp-admin/includes/upgrade.php index c21f951b3f..ca401f363b 100644 --- a/src/wp-admin/includes/upgrade.php +++ b/src/wp-admin/includes/upgrade.php @@ -442,9 +442,6 @@ function upgrade_all() { if ( $wp_current_db_version < 29630 ) upgrade_400(); - if ( $wp_current_db_version < 30056 ) - upgrade_410(); - maybe_disable_link_manager(); maybe_disable_automattic_widgets(); @@ -1331,18 +1328,6 @@ function upgrade_400() { } } -/** - * Execute changes made in WordPress 4.1.0. - * - * @since 4.1.0 - */ -function upgrade_410() { - global $wp_current_db_version, $wpdb; - if ( $wp_current_db_version < 30056 ) { - add_clean_index( $wpdb->terms, 'slug' ); - } -} - /** * Execute network level changes * @@ -2205,6 +2190,11 @@ function pre_schema_upgrade() { $wpdb->query( "ALTER TABLE $wpdb->blogs CHANGE COLUMN archived archived tinyint(2) NOT NULL default 0" ); } } + + if ( $wp_current_db_version < 30133 ) { + // dbDelta() can recreate but can't drop the index. + $wpdb->query( "ALTER TABLE $wpdb->terms DROP INDEX slug" ); + } } /** diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php index 99dda7153e..db9af0ac98 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -11,7 +11,7 @@ $wp_version = '4.1-alpha-30000-src'; * * @global int $wp_db_version */ -$wp_db_version = 30056; +$wp_db_version = 30133; /** * Holds the TinyMCE version