Changeset 10354 for trunk/src/bp-core/admin/bp-core-admin-schema.php
- Timestamp:
- 11/15/2015 06:56:24 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/bp-core/admin/bp-core-admin-schema.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-schema.php
r10108 r10354 16 16 * 17 17 * @global $wpdb $wpdb 18 * 18 19 * @return string The default database character-set, if set. 19 20 */ … … 40 41 bp_pre_schema_upgrade(); 41 42 42 // If no components passed, get all the active components from the main site 43 // If no components passed, get all the active components from the main site. 43 44 if ( empty( $active_components ) ) { 44 45 … … 47 48 } 48 49 49 // Install Activity Streams even when inactive (to store last_activity data) 50 // Install Activity Streams even when inactive (to store last_activity data). 50 51 bp_core_install_activity_streams(); 51 52 52 // Install the signups table 53 // Install the signups table. 53 54 bp_core_maybe_install_signups(); 54 55 55 // Notifications 56 // Notifications. 56 57 if ( !empty( $active_components['notifications'] ) ) { 57 58 bp_core_install_notifications(); 58 59 } 59 60 60 // Friend Connections 61 // Friend Connections. 61 62 if ( !empty( $active_components['friends'] ) ) { 62 63 bp_core_install_friends(); 63 64 } 64 65 65 // Extensible Groups 66 // Extensible Groups. 66 67 if ( !empty( $active_components['groups'] ) ) { 67 68 bp_core_install_groups(); 68 69 } 69 70 70 // Private Messaging 71 // Private Messaging. 71 72 if ( !empty( $active_components['messages'] ) ) { 72 73 bp_core_install_private_messaging(); 73 74 } 74 75 75 // Extended Profiles 76 // Extended Profiles. 76 77 if ( !empty( $active_components['xprofile'] ) ) { 77 78 bp_core_install_extended_profiles(); 78 79 } 79 80 80 // Blog tracking 81 // Blog tracking. 81 82 if ( !empty( $active_components['blogs'] ) ) { 82 83 bp_core_install_blog_tracking(); … … 345 346 $bp_prefix = bp_core_get_table_prefix(); 346 347 347 // These values should only be updated if they are not already present 348 // These values should only be updated if they are not already present. 348 349 if ( ! bp_get_option( 'bp-xprofile-base-group-name' ) ) { 349 350 bp_update_option( 'bp-xprofile-base-group-name', _x( 'General', 'First field-group name', 'buddypress' ) ); … … 405 406 dbDelta( $sql ); 406 407 407 // Insert the default group and fields 408 // Insert the default group and fields. 408 409 $insert_sql = array(); 409 410 … … 466 467 global $wpdb; 467 468 468 // Signups is not there and we need it so let's create it 469 // Signups is not there and we need it so let's create it. 469 470 require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' ); 470 471 require_once( ABSPATH . 'wp-admin/includes/upgrade.php' ); 471 472 472 // Never use bp_core_get_table_prefix() for any global users tables 473 // Never use bp_core_get_table_prefix() for any global users tables. 473 474 $wpdb->signups = $wpdb->base_prefix . 'signups'; 474 475 475 // Use WP's core CREATE TABLE query 476 // Use WP's core CREATE TABLE query. 476 477 $create_queries = wp_get_db_schema( 'ms_global' ); 477 478 if ( ! is_array( $create_queries ) ) { … … 480 481 } 481 482 482 // Filter out all the queries except wp_signups 483 // Filter out all the queries except wp_signups. 483 484 foreach ( $create_queries as $key => $query ) { 484 485 if ( preg_match( "|CREATE TABLE ([^ ]*)|", $query, $matches ) ) { … … 489 490 } 490 491 491 // Run WordPress's database upgrader 492 // Run WordPress's database upgrader. 492 493 if ( ! empty( $create_queries ) ) { 493 494 dbDelta( $create_queries ); … … 513 514 global $wpdb; 514 515 515 // Bail if global tables should not be upgraded 516 // Bail if global tables should not be upgraded. 516 517 if ( defined( 'DO_NOT_UPGRADE_GLOBAL_TABLES' ) ) { 517 518 return; 518 519 } 519 520 520 // Never use bp_core_get_table_prefix() for any global users tables 521 // Never use bp_core_get_table_prefix() for any global users tables. 521 522 $wpdb->signups = $wpdb->base_prefix . 'signups'; 522 523 523 // Attempt to alter the signups table 524 // Attempt to alter the signups table. 524 525 $wpdb->query( "ALTER TABLE {$wpdb->signups} ADD signup_id BIGINT(20) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST" ); 525 526 $wpdb->query( "ALTER TABLE {$wpdb->signups} DROP INDEX domain" );
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)