Changeset 13907
- Timestamp:
- 06/06/2024 08:36:00 PM (20 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
-
blueprint.json (added)
-
src/bp-core/admin/bp-core-admin-schema.php (modified) (3 diffs)
-
src/bp-core/bp-core-update.php (modified) (2 diffs)
-
src/class-buddypress.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/admin/bp-core-admin-schema.php
r13886 r13907 92 92 component_action varchar(75) NOT NULL, 93 93 date_notified datetime NOT NULL, 94 is_new boolNOT NULL DEFAULT 0,94 is_new tinyint(1) NOT NULL DEFAULT 0, 95 95 KEY item_id (item_id), 96 96 KEY secondary_item_id (secondary_item_id), … … 135 135 secondary_item_id bigint(20) DEFAULT NULL, 136 136 date_recorded datetime NOT NULL, 137 hide_sitewide boolDEFAULT 0,137 hide_sitewide tinyint(1) DEFAULT 0, 138 138 mptt_left int(11) NOT NULL DEFAULT 0, 139 139 mptt_right int(11) NOT NULL DEFAULT 0, … … 177 177 initiator_user_id bigint(20) NOT NULL, 178 178 friend_user_id bigint(20) NOT NULL, 179 is_confirmed boolDEFAULT 0,180 is_limited boolDEFAULT 0,179 is_confirmed tinyint(1) DEFAULT 0, 180 is_limited tinyint(1) DEFAULT 0, 181 181 date_created datetime NOT NULL, 182 182 KEY initiator_user_id (initiator_user_id), -
trunk/src/bp-core/bp-core-update.php
r13903 r13907 314 314 if ( $raw_db_version < 13422 ) { 315 315 bp_update_to_12_0(); 316 } 317 318 // Version 14.0.0. 319 if ( $raw_db_version < 13906 ) { 320 bp_update_to_14_0(); 316 321 } 317 322 } … … 939 944 940 945 /** 946 * 14.0.0 update routine. 947 * 948 * Edit db schema to stop using boolean fields in favor of tinyint ones. 949 * This moves was necessary to support WP Playground. 950 * 951 * @since 14.0.0 952 */ 953 function bp_update_to_14_0() { 954 global $wpdb; 955 $bp = buddypress(); 956 $bp_prefix = bp_core_get_table_prefix(); 957 958 if ( isset( $bp->members->table_name_last_activity ) && $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->members->table_name_last_activity}%'" ) ) { 959 if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->members->table_name_last_activity} LIKE 'hide_sitewide'" ) ) { 960 $wpdb->query( "ALTER TABLE {$bp->members->table_name_last_activity} CHANGE hide_sitewide hide_sitewide tinyint(1) DEFAULT 0" ); 961 } 962 } 963 964 if ( isset( $bp->friends->table_name ) && $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->friends->table_name}%'" ) ) { 965 if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->friends->table_name} LIKE 'is_confirmed'" ) ) { 966 $wpdb->query( "ALTER TABLE {$bp->friends->table_name} CHANGE is_confirmed is_confirmed tinyint(1) DEFAULT 0" ); 967 } 968 969 if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->friends->table_name} LIKE 'is_limited'" ) ) { 970 $wpdb->query( "ALTER TABLE {$bp->friends->table_name} CHANGE is_limited is_limited tinyint(1) DEFAULT 0" ); 971 } 972 } 973 974 if ( isset( $bp->notifications->table_name ) && $wpdb->get_var( "SHOW TABLES LIKE '%{$bp->notifications->table_name}%'" ) ) { 975 if ( $wpdb->get_var( "SHOW COLUMNS FROM {$bp->notifications->table_name} LIKE 'is_new'" ) ) { 976 $wpdb->query( "ALTER TABLE {$bp->notifications->table_name} CHANGE is_new is_new tinyint(1) NOT NULL DEFAULT 0" ); 977 } 978 } 979 } 980 981 /** 941 982 * Updates the component field for new_members type. 942 983 * -
trunk/src/class-buddypress.php
r13885 r13907 462 462 463 463 $this->version = '14.0.0-alpha'; 464 $this->db_version = 13 422;464 $this->db_version = 13906; 465 465 466 466 /** Loading */
Note: See TracChangeset
for help on using the changeset viewer.