I'm getting this error when runing the updates after going from 7.x-2.4 to 7.x-2.x-dev (on a D7.35 installation):

Update #7212

Failed: DatabaseSchemaObjectExistsException: Cannot add primary key to table weight_settings: primary key already exists. in DatabaseSchema_mysql->addPrimaryKey() (line 397 of /data/sites/web/mydomain/www/includes/database/mysql/schema.inc).

What could be the cause of this error (and what's the best approach to fix this) please?

Comments

knalstaaf’s picture

Not sure if it's related, but the 7.x-2.4 version was patched before.

davisben’s picture

Status: Active » Fixed

I modified weight_update_7212 so that it only tries to change the primary key if it is also dropping the old one.

  • davisben committed 69f2df5 on 7.x-2.x
    Issue #2468761 by davisben: Cannot add primary key to table...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.