Changeset 9716 for trunk/src/bp-core/bp-core-update.php
- Timestamp:
- 04/07/2015 01:28:21 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-update.php
r9615 r9716 258 258 // Bump the version 259 259 bp_version_bump(); 260 } 261 262 /** 263 * Perform database operations that must take place before the general schema upgrades. 264 * 265 * `dbDelta()` cannot handle certain operations - like changing indexes - so we do it here instead. 266 * 267 * @since BuddyPress (2.3.0) 268 */ 269 function bp_pre_schema_upgrade() { 270 global $wpdb; 271 272 $raw_db_version = (int) bp_get_db_version_raw(); 273 $bp_prefix = bp_core_get_table_prefix(); 274 275 // 2.3.0: Change index lengths to account for utf8mb4. 276 if ( $raw_db_version < 9695 ) { 277 // table_name => columns. 278 $tables = array( 279 $bp_prefix . 'bp_activity_meta' => array( 'meta_key' ), 280 $bp_prefix . 'bp_groups_groupmeta' => array( 'meta_key' ), 281 $bp_prefix . 'bp_messages_meta' => array( 'meta_key' ), 282 $bp_prefix . 'bp_notifications_meta' => array( 'meta_key' ), 283 $bp_prefix . 'bp_user_blogs_blogmeta' => array( 'meta_key' ), 284 $bp_prefix . 'bp_xprofile_meta' => array( 'meta_key' ), 285 ); 286 287 foreach ( $tables as $table_name => $indexes ) { 288 foreach ( $indexes as $index ) { 289 $wpdb->query( "ALTER TABLE $table_name DROP INDEX $index" ); 290 } 291 } 292 } 260 293 } 261 294
Note: See TracChangeset
for help on using the changeset viewer.