Skip to content

Commit

Permalink
[REVERT-4398] PROD-6979 migrate to platform pro
Browse files Browse the repository at this point in the history
  • Loading branch information
bb-yudhisthir committed May 8, 2024
1 parent 9a5f1ff commit dba167e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 58 deletions.
4 changes: 0 additions & 4 deletions src/bp-activity/bp-activity-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6127,10 +6127,6 @@ function bb_activity_migration( $raw_db_version, $current_db ) {
}
}
}

if ( bp_is_active( 'activity' ) && class_exists( 'BB_Schedule_Posts' ) ) {
BB_Schedule_Posts::bb_create_activity_schedule_cron_event();
}
}

/**
Expand Down
54 changes: 0 additions & 54 deletions src/bp-core/bp-core-update.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,6 @@ function bp_version_updater() {
bb_update_to_2_5_80();
}

if ( $raw_db_version < 21101 ) {
bb_update_to_2_6_00();
}

if ( $raw_db_version !== $current_db ) {
// @todo - Write only data manipulate migration here. ( This is not for DB structure change ).

Expand Down Expand Up @@ -3498,53 +3494,3 @@ function bb_update_to_2_5_80() {
bp_update_option( 'bb_ajax_request_page_load', 2 );
bp_update_option( 'bb_load_activity_per_request', 10 );
}

/**
* Create a new column in database tables.
*
* @since BuddyBoss [BBVERSION]
*
* @return void
*/
function bb_update_to_2_6_00() {
global $wpdb;
$bp_prefix = bp_core_get_table_prefix();

// Check if the 'bp_activity' table exists.
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$table_exists = $wpdb->get_var( "SHOW TABLES LIKE '{$bp_prefix}bp_activity'" );
if ( $table_exists ) {

// Add 'status' column in 'bp_activity' table.
$row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema= '" . DB_NAME . "' AND table_name = '{$bp_prefix}bp_activity' AND column_name = 'status'" ); //phpcs:ignore
if ( empty( $row ) ) {
$wpdb->query( "ALTER TABLE {$bp_prefix}bp_activity ADD `status` varchar( 20 ) NOT NULL DEFAULT 'published' AFTER `privacy`" ); //phpcs:ignore
}
}

// Check if the 'bp_media' table exists.
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$table_exists = $wpdb->get_var( "SHOW TABLES LIKE '{$bp_prefix}bp_media'" );
if ( $table_exists ) {

// Add 'status' column in 'bp_media' table.
$row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema= '" . DB_NAME . "' AND table_name = '{$bp_prefix}bp_media' AND column_name = 'status'" ); //phpcs:ignore

if ( empty( $row ) ) {
$wpdb->query( "ALTER TABLE {$bp_prefix}bp_media ADD `status` varchar( 20 ) NOT NULL DEFAULT 'published' AFTER `menu_order`" ); //phpcs:ignore
}
}

// Check if the 'bp_document' table exists.
// phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared
$table_exists = $wpdb->get_var( "SHOW TABLES LIKE '{$bp_prefix}bp_document'" );
if ( $table_exists ) {

// Add 'status' column in 'bp_document' table.
$row = $wpdb->get_results( "SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema= '" . DB_NAME . "' AND table_name = '{$bp_prefix}bp_document' AND column_name = 'status'" ); //phpcs:ignore

if ( empty( $row ) ) {
$wpdb->query( "ALTER TABLE {$bp_prefix}bp_document ADD `status` varchar( 20 ) NOT NULL DEFAULT 'published' AFTER `menu_order`" ); //phpcs:ignore
}
}
}

0 comments on commit dba167e

Please sign in to comment.