Add signup_id primary key to $wpdb->signups, and add better indexes.

props josephscott, pento, barry.
see #15004.


git-svn-id: https://develop.svn.wordpress.org/trunk@25179 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-08-30 04:29:06 +00:00
parent 381affa4e4
commit 21b61a9e6f
3 changed files with 11 additions and 2 deletions

View File

@ -272,6 +272,7 @@ CREATE TABLE $wpdb->sitemeta (
KEY site_id (site_id) KEY site_id (site_id)
) $charset_collate; ) $charset_collate;
CREATE TABLE $wpdb->signups ( CREATE TABLE $wpdb->signups (
signup_id bigint(20) NOT NULL auto_increment,
domain varchar(200) NOT NULL default '', domain varchar(200) NOT NULL default '',
path varchar(100) NOT NULL default '', path varchar(100) NOT NULL default '',
title longtext NOT NULL, title longtext NOT NULL,
@ -282,8 +283,11 @@ CREATE TABLE $wpdb->signups (
active tinyint(1) NOT NULL default '0', active tinyint(1) NOT NULL default '0',
activation_key varchar(50) NOT NULL default '', activation_key varchar(50) NOT NULL default '',
meta longtext, meta longtext,
PRIMARY KEY (signup_id),
KEY activation_key (activation_key), KEY activation_key (activation_key),
KEY domain (domain) KEY user_email (user_email)
KEY user_login_email (user_login,user_email),
KEY domain_path (domain,path),
) $charset_collate;"; ) $charset_collate;";
switch ( $scope ) { switch ( $scope ) {

View File

@ -1978,6 +1978,11 @@ function pre_schema_upgrade() {
$wpdb->query("ALTER TABLE $wpdb->options DROP INDEX option_name"); $wpdb->query("ALTER TABLE $wpdb->options DROP INDEX option_name");
} }
// Upgrade verions prior to 3.7
if ( $wp_current_db_version < 25179 && is_multisite() && is_main_network() && ! defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) {
$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" );
}
} }
/** /**

View File

@ -11,7 +11,7 @@ $wp_version = '3.7-alpha-25157';
* *
* @global int $wp_db_version * @global int $wp_db_version
*/ */
$wp_db_version = 24448; $wp_db_version = 25179;
/** /**
* Holds the TinyMCE version * Holds the TinyMCE version