Changeset 31349 for trunk/src/wp-admin/includes/schema.php
- Timestamp:
- 02/06/2015 04:50:19 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/schema.php
r30742 r31349 44 44 // Engage multisite if in the middle of turning it on from network.php. 45 45 $is_multisite = is_multisite() || ( defined( 'WP_INSTALLING_NETWORK' ) && WP_INSTALLING_NETWORK ); 46 47 /* 48 * Indexes have a maximum size of 767 bytes. Historically, we haven't need to be concerned about that. 49 * As of 4.2, however, we moved to utf8mb4, which uses 4 bytes per character. This means that an index which 50 * used to have room for floor(767/3) = 255 characters, now only has room for floor(767/4) = 191 characters. 51 */ 52 $max_index_length = 191; 46 53 47 54 // Blog specific tables. … … 52 59 term_group bigint(10) NOT NULL default 0, 53 60 PRIMARY KEY (term_id), 54 KEY slug (slug ),55 KEY name (name )61 KEY slug (slug($max_index_length)), 62 KEY name (name($max_index_length)) 56 63 ) $charset_collate; 57 64 CREATE TABLE $wpdb->term_taxonomy ( … … 80 87 PRIMARY KEY (meta_id), 81 88 KEY comment_id (comment_id), 82 KEY meta_key (meta_key )89 KEY meta_key (meta_key($max_index_length)) 83 90 ) $charset_collate; 84 91 CREATE TABLE $wpdb->comments ( … … 137 144 PRIMARY KEY (meta_id), 138 145 KEY post_id (post_id), 139 KEY meta_key (meta_key )146 KEY meta_key (meta_key($max_index_length)) 140 147 ) $charset_collate; 141 148 CREATE TABLE $wpdb->posts ( … … 164 171 comment_count bigint(20) NOT NULL default '0', 165 172 PRIMARY KEY (ID), 166 KEY post_name (post_name ),173 KEY post_name (post_name($max_index_length)), 167 174 KEY type_status_date (post_type,post_status,post_date,ID), 168 175 KEY post_parent (post_parent), … … 214 221 PRIMARY KEY (umeta_id), 215 222 KEY user_id (user_id), 216 KEY meta_key (meta_key )223 KEY meta_key (meta_key($max_index_length)) 217 224 ) $charset_collate;\n"; 218 225 … … 262 269 path varchar(100) NOT NULL default '', 263 270 PRIMARY KEY (id), 264 KEY domain (domain ,path)271 KEY domain (domain(140),path(51)) 265 272 ) $charset_collate; 266 273 CREATE TABLE $wpdb->sitemeta ( … … 270 277 meta_value longtext, 271 278 PRIMARY KEY (meta_id), 272 KEY meta_key (meta_key ),279 KEY meta_key (meta_key($max_index_length)), 273 280 KEY site_id (site_id) 274 281 ) $charset_collate; … … 289 296 KEY user_email (user_email), 290 297 KEY user_login_email (user_login,user_email), 291 KEY domain_path (domain ,path)298 KEY domain_path (domain(140),path(51)) 292 299 ) $charset_collate;"; 293 300
Note: See TracChangeset
for help on using the changeset viewer.