unknown column pmi.uid

rastatt@drupal.org - October 14, 2008 - 16:49
Project:Privatemsg
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:won't fix
Description

I applied the latest dev version of privatemsg and it caused the following error (I also ran update.php which showed no necessary updates):

user warning: Unknown column 'pmi.uid' in 'where clause' query: SELECT COUNT(DISTINCT thread_id) as unread_count FROM pm_index pmi WHERE (pmi.new = 1) AND (pmi.uid = 1) in C:\xampp\htdocs\sites\all\modules\privatemsg\privatemsg.module on line 352.

#1

litwol - October 14, 2008 - 17:05

edit: removed in favor of nbz's explanation

#2

nbz - October 15, 2008 - 19:06

Are you using HEAD or 6.x-1.x-dev?

If HEAD, did you upgrade from a previous version?

HEAD has undergone a change to the schema where the author and recipient columns in pm_index have been merged, however there is no upgrade path from the previous version.

Are you using this on a production site? Does the old data need to be kept? If so, you will need to manually update your database with the following changes:

1. Rename the recipient column to uid in pm_index (or create a new column called uid, copy data over and then drop the recipient column as per other drops in step 4)
2. Add a timestamp column into the pm_index table and fill it with timestamp from the timestamp field in pm_index (using mid to match).
3. Add a row of data per message adding the author into the uid field in pm_index.
4. Drop timestamp, author and timestamp from pm_index.

If you do not need to keep the old data, you can then just uninstall the module, reinstall and the correct tables will be created.

On a more positive note, we are close to the stage where we can release a beta and declare the schema stable - or atleast provide upgrade paths from D5 and also between any further schema changes.

#3

litwol - October 14, 2008 - 17:05
Status:active» won't fix

#4

scotese - November 9, 2008 - 16:10

I am having the same problem and would gladly uninstall privatemsg, but there doesn't seem to be an uninstall option for that module on my uninstall page -- what tables do I need to delete if I want to do it manually -- thanks.

#5

nbz - November 9, 2008 - 16:17

disable the module from the module listing page first - that should show an uninstall option on the uninstall page.

As for particular tables, the module creates pm_message and pm_index in the database.

 
 

Drupal is a registered trademark of Dries Buytaert.