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

STINGER_LP’s picture

Same 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.

ivnish’s picture

Issue summary: View changes
Status: Active » Closed (outdated)