I have a drupal site which uses CCK content fields to store a majority of its data.
I want to manually change some of the data to point to a different node version.
UPDATE content_field_table SET vid = '1234' WHERE nid = '12' AND vid = '123';
The problem is that content_field_table has a composite primary key of
PRIMARY KEY (`vid`,`delta`)
So that when I run the update statement, I get the following error:
Error Code: 1062
Duplicate entry ‘52979-0’ for key ‘PRIMARY’
How can I update the vid as needed?
A Primary Key must be unique. So you cannot change one record to have the same PK as an existing record
For example if you get any records from the SQL below then the update you want to perform cannot be done. You’ll either need to make some other change first or delete a record or remove the PK