Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Broken activity


arghagain
Participant

@arghagain

OK, I saw this in bp-activity.php:

/* Drop the old sitewide and user activity tables */

$wpdb->query( “DROP TABLE IF EXISTS {$wpdb->base_prefix}bp_activity_user_activity” );

$wpdb->query( “DROP TABLE IF EXISTS {$wpdb->base_prefix}bp_activity_sitewide” );

And so I look in the db and saw there is no bp_activity_user_activity table, and there is no bp_activity_sitewide table. This means it’s a good thing since these got dropped.

Though I saw this

$sql[] = “CREATE TABLE {$bp->activity->table_name}

but to my lack of knowledge of programming, I see this and think it’s bp_activity_something (but no idea)…

Looked everywhere and I only saw this in db bp_activity_user_activity_cached. This table doesn’t look like it was created by

$sql[] = “CREATE TABLE {$bp->activity->table_name}, but I could be wrong because I looked at the part under $sql[] = “CREATE TABLE {$bp->activity ->table_name} and saw similar rows get created and these rows are in my bp_activity_user_activity_cached table.

For example, in bp-activity.php,

function bp_activity_install() {

global $wpdb, $bp;

if ( !empty($wpdb->charset) )

$charset_collate = “DEFAULT CHARACTER SET $wpdb->charset”;

$sql[] = “CREATE TABLE {$bp->activity->table_name} (

id bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY,

user_id bigint(20) NOT NULL,

component_name varchar(75) NOT NULL,

component_action varchar(75) NOT NULL,

content longtext NOT NULL,

primary_link varchar(150) NOT NULL,

item_id varchar(75) NOT NULL,

secondary_item_id varchar(75) NOT NULL,

date_recorded datetime NOT NULL,

hide_sitewide bool DEFAULT 0,

KEY date_recorded (date_recorded),

KEY user_id (user_id),

KEY item_id (item_id),

KEY component_name (component_name)

) {$charset_collate};”;

require_once( ABSPATH . ‘wp-admin/upgrade-functions.php’ );

dbDelta($sql);

In my current db, table bp_activity_user_activity_cached has everything except hide_sitewide row. In my current db, table bp_activity_user_activity_cached has extra rows that function_bp_activity_install doesn’t have such as date_cached and is_private rows.

Any suggestion? What rows should I add or remove? Am I looking at the right stuff?

Looked like at the end of the function bp_activity_install(), it has require_once( ABSPATH . ‘wp-admin/upgrade-functions.php’ );

dbDelta($sql);

Maybe the upgrade-functions.php had not gone smoothly?

Skip to toolbar