Skip to:
Content

BuddyPress.org

Changeset 2668


Ignore:
Timestamp:
02/11/2010 01:13:14 PM (14 years ago)
Author:
apeatling
Message:

Fixes #1884

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2666 r2668  
    1818
    1919    /* Rename the old user activity cached table if needed. */
    20     if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$wpdb->base_prefix}bp_activity_user_activity_cached%'" ) ) {
     20    if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$wpdb->base_prefix}bp_activity_user_activity_cached%'" ) )
    2121        $wpdb->query( "RENAME TABLE {$wpdb->base_prefix}bp_activity_user_activity_cached TO {$bp->activity->table_name}" );
    22     }
    2322
    2423    /* Rename fields from pre BP 1.2 */
    2524    if ( $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->activity->table_name}%'" ) ) {
    26         $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" );
    27         $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" );
     25        if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) )
     26            $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" );
     27
     28        if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_name'" ) )
     29            $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_name component varchar(75) NOT NULL" );
    2830    }
    2931
  • trunk/bp-xprofile.php

    r2656 r2668  
    7777
    7878    if ( '' == get_site_option( 'bp-xprofile-db-version' ) ) {
    79         $sql[] = "INSERT INTO {$bp->profile->table_name_groups} VALUES ( 1, '" . get_site_option( 'bp-xprofile-base-group-name' ) . "', '', 0 );";
    80 
    81         $sql[] = "INSERT INTO {$bp->profile->table_name_fields} (
    82                     id, group_id, parent_id, type, name, is_required, can_delete
    83                   ) VALUES (
    84                     1, 1, 0, 'textbox', '" . get_site_option( 'bp-xprofile-fullname-field-name' ) . "', 1, 0
    85                   );";
     79        if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_groups} WHERE id = 1" ) )
     80            $sql[] = "INSERT INTO {$bp->profile->table_name_groups} VALUES ( 1, '" . get_site_option( 'bp-xprofile-base-group-name' ) . "', '', 0 );";
     81
     82        if ( !$wpdb->get_var( "SELECT id FROM {$bp->profile->table_name_fields} WHERE id = 1" ) ) {
     83            $sql[] = "INSERT INTO {$bp->profile->table_name_fields} (
     84                        id, group_id, parent_id, type, name, is_required, can_delete
     85                      ) VALUES (
     86                        1, 1, 0, 'textbox', '" . get_site_option( 'bp-xprofile-fullname-field-name' ) . "', 1, 0
     87                      );";
     88        }
    8689    }
    8790
Note: See TracChangeset for help on using the changeset viewer.