Closed (outdated)
Project:
Privatemsg
Version:
7.x-1.3
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2012 at 20:35 UTC
Updated:
27 Jul 2022 at 06:58 UTC
Jump to comment: Most recent
I've just updated my site from Drupal 6 to 7. All is going well until I try to update PrivateMSG. When running update.php the system won't go past update 7005. When I look at my old Drupal 6 database it seems that the problem existed there aswell. Anyone got any idea how to solve this?
Update #7005
Failed: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '5262-0-user' for key 'PRIMARY': ALTER TABLE {pm_index} ADD PRIMARY KEY (`mid`, `recipient`, `type`); Array ( ) in db_add_primary_key() (line 2862 of /var/www/d7.thegreyguard.net/includes/database/database.inc).
Comments
Comment #1
STINGER_LP commentedSame here, after upgrading from D6 to D7 Privatemsg gives me the same error on update #7005. But after digging into this issue for a bit I've came to conclusion that update #7005 is mistaken - you simply can't make columns "mid", "recipient", "type" in "pm_index" table as PRIMARY KEYs, because column marked as PRIMARY KEY by definition must have UNIQUE values. But "mid", "recipient" and "type" have a lot of recurring values, so they can't be primary keys (that's why "Duplicate entry" error occurred).
I simply removed this update from privatemsg.install so it won't bother me later. Hope this will get reviewed and fixed in later versions.
Comment #2
ivnish