Ticket #1884: sql-fix.diff
File sql-fix.diff, 2.2 KB (added by , 15 years ago) |
---|
-
bp-activity.php
23 23 24 24 /* Rename fields from pre BP 1.2 */ 25 25 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" ); 26 if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->activity->table_name} LIKE 'component_action'" ) ) 27 $wpdb->query( "ALTER TABLE {$bp->activity->table_name} CHANGE component_action type varchar(75) NOT NULL" ); 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" ); 28 30 } 29 31 30 32 /** -
bp-xprofile.php
76 76 ) {$charset_collate};"; 77 77 78 78 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 );"; 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 );"; 80 81 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 );"; 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 );"; 86 88 } 87 89 88 90 require_once( ABSPATH . 'wp-admin/upgrade-functions.php' );