Closed (duplicate)
Project:
Drupal core
Version:
6.13
Component:
system.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2008 at 18:40 UTC
Updated:
25 Sep 2009 at 18:00 UTC
I have upgraded from 5.13 to 6.7 today and got this error:
user warning: Duplicate entry '3896-0' for key 1 query: ALTER TABLE locales_target ADD PRIMARY KEY (language, lid, plural) in .../html/includes/database.mysql-common.inc on line 374.
I think this is the system_update_6043 that fails and now the schema is inconsistent:
// Alter locale table to add a primary key, drop an index.
if (db_table_exists('locales_target')) {
db_add_primary_key($ret, 'locales_target', array('language', 'lid', 'plural'));
}
Comments
Comment #1
ryosaeba commentedI've the same problem
This is my error:
user warning: Duplicate entry '636-0' for key 1 query: ALTER TABLE locales_target ADD PRIMARY KEY (language, lid, plural) in /Applications/MAMP/htdocs/walterfantauzzi/includes/database.mysql-common.inc on line 374.
What I must do for resolve it?
Comment #2
hass commentedRemove the duplicate entry and manually add the primary key... :-(
Comment #3
TheRec commentedComment #4
strellman commentedStill happening on d6.13
I don't know SQL syntax so manually add it was too vague for me.
If your warning is:
Duplicate entry '1-0' for key 1 query: ALTER TABLE locales_target ADD PRIMARY KEY
Then go to phpmyadmin find your database, look at the table structure, in the SQL tab type:
ALTER TABLE locales_target ADD PRIMARY KEY (language, lid, plural)
See also same issue at http://drupal.org/node/223077#comment-1703798
Comment #5
catchDuplicate of #223077: update 5.7 to 6.0 failed "ALTER TABLE {locales_target} ADD PRIMARY KEY (language, lid, plural)"