'drupal_iikcom.activity_targets' doesn't exist
grendelshitsuren - February 5, 2008 - 11:55
| Project: | Activity |
| Version: | 5.x-3.0-beta |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | sirkitree |
| Status: | patch (code needs review) |
Description
Hi,
I updated to the newest activity module version and got this error:
* user warning: Table 'drupal_iikcom.activity_targets' doesn't exist query: SELECT COUNT(*) FROM activity_targets at INNER JOIN activity a ON a.aid = at.aid WHERE at.target_uid = -1 in /httpd/.../includes/database.mysql.inc on line 172.
* user warning: Table 'drupal_iikcom.activity_targets' doesn't exist query: SELECT a.*, at.target_uid, at.target_role FROM activity_targets at INNER JOIN activity a ON a.aid = at.aid WHERE at.target_uid = -1 ORDER BY a.created DESC LIMIT 0, 6 in /httpd/.../includes/database.mysql.inc on line 172.
Running update.php didn't help, what can I do?

#1
Sorry, there was no update path. This patch will do the following:
change 'token' field in {activity} to 'data'
insert {activity_targets} if it does not exist
attempt to insert records into activity_targets so that the old activity will show up.
Please note that this last operation can be VERY INTENSIVE if you have a LOT of records in the activity table.
#2
Here's an updated patch... seems there were more changes then I first noticed.
There were a few renamed fields and a whole new table.
When I attempted to convert my existing site I nearly crashed my localhost as the activity table had over 332,000 records. So in the update hook I first discard any anonymous user records. I then removed all but 20 records per user and THEN I insert two default targets into activity_targets for each record. This was still very intense though I had gotten the 332,000 records down to around 75,000.
After that you need to enable the contrib modules and make sure your tokens are set.
HOWEVER if you're upgrading form version 2, you will probably still not see your custom messages because the way serialized data is stored has changed as well. To pull all of this serialized data apart and convert it to the way it is now inserted, per module, would probably blow up my laptop, so I'm not even going to attempt.
What am I getting at? Well there is no current way to successfully convert existing activity, unless someone wants to help me out here, I'm going to work on converting the other contribs to the new API... votingapi and viewsbookmark.