Skip to content

Commit

Permalink
[ARCH-131] PROD-7948 - Change table name - because keep sequence for …
Browse files Browse the repository at this point in the history
…all moderation table
  • Loading branch information
jitendrabanjara1991 committed Oct 7, 2024
1 parent 49e9535 commit bdad908
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/bp-core/admin/bp-core-admin-schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ function bp_core_install_suspend() {
KEY suspend_details_id (suspend_id,user_id)
) {$charset_collate};";

$sql[] = "CREATE TABLE {$bp_prefix}bb_suspend_meta (
$sql[] = "CREATE TABLE {$bp_prefix}bp_suspend_meta (
id bigint(20) NOT NULL AUTO_INCREMENT,
suspend_id bigint(20) NOT NULL,
meta_key varchar(255) DEFAULT NULL,
Expand Down
6 changes: 3 additions & 3 deletions src/bp-moderation/bp-moderation-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2176,16 +2176,16 @@ function bb_moderation_migration_on_update() {
* @since BuddyBoss [BBVERSION]
*/
$bp_prefix = function_exists( 'bp_core_get_table_prefix' ) ? bp_core_get_table_prefix() : $wpdb->base_prefix;
$table_name = $bp_prefix . 'bb_suspend_meta';
// Check if the 'bb_suspend_meta' table exists.
$table_name = $bp_prefix . 'bp_suspend_meta';
// Check if the 'bp_suspend_meta' table exists.
$table_exists = $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table_name ) ); // phpcs:ignore

if ( $table_exists !== $table_name ) {
$sql = array();
$charset_collate = $GLOBALS['wpdb']->get_charset_collate();
$bp_prefix = bp_core_get_table_prefix();

$sql[] = "CREATE TABLE {$bp_prefix}bb_suspend_meta (
$sql[] = "CREATE TABLE {$bp_prefix}bp_suspend_meta (
id bigint(20) NOT NULL AUTO_INCREMENT,
suspend_id bigint(20) NOT NULL,
meta_key varchar(255) DEFAULT NULL,
Expand Down
4 changes: 2 additions & 2 deletions src/bp-moderation/classes/class-bp-moderation-component.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ public function setup_globals( $args = array() ) {
'table_name' => $bp->table_prefix . 'bp_suspend',
'table_name_reports' => $bp->table_prefix . 'bp_moderation',
'table_name_meta' => $bp->table_prefix . 'bp_moderation_meta',
'table_name_suspend_meta' => $bp->table_prefix . 'bb_suspend_meta',
'table_name_suspend_meta' => $bp->table_prefix . 'bp_suspend_meta',
);

// Metadata tables for groups component.
$meta_tables = array(
'moderation' => $bp->table_prefix . 'bp_moderation_meta',
'suspend' => $bp->table_prefix . 'bb_suspend_meta',
'suspend' => $bp->table_prefix . 'bp_suspend_meta',
);

// Fetch the default directory title.
Expand Down

0 comments on commit bdad908

Please sign in to comment.