SQLSTATE: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
(`magento_vb/googleoptimizer_code`, CONSTRAINT `FK_GOOGLEOPTIMIZER_CODE_STORE` FOREIGN KEY (`store_id`)
REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE)
The above is the error I get when trying to update existing products in the system. I have upgraded to version 1.1.8 and the problem is still persistent.
I have not attempted to use any of the new Google features, but everything else appears to be still working OK.
Anyone have any tips to resolve this?
It seems that the table googleOptimizer_code is being setup as an innodb table, but core_store is not, therefore the constraint violation. I recreated the googleoptimizer_code table without the InnoDB type and the error is corrected.
Question is should this table be Innodb and if so why is core_store not?
OK after comparing another Database it seems that loads of tables in my new database were MyISAM when they should have been InnoDB. I think this is related to originally installing the DB on a Linux server and then migrating it to an OSX dev machine. I think the Linux server may have had InnoDB disabled or something like that,, thus the mess up. Resolution was to dump the database, edit the SQL to change the tables to InnoDB as required and then import the database again. Fingers crossed that this is the end of this and similar problems.