FOREIGN KEY problem on Packages
An exception occurred while executing 'ALTER TABLE AttributeSets ADD CONSTRAINT FK_FCA02D5FCE45CBB0 FOREIGN KEY (pkgID) REFERENCES Packages (pkgID)': SQLSTATE: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`databasename`.`#sql-1ca9_3504d`, CONSTRAINT `FK_FCA02D5FCE45CBB0` FOREIGN KEY (`pkgID`) REFERENCES `Packages` (`pkgID`))
This is a version 8.2.1 site, but its been upgraded from version 7.x. Probably has something to do with the upgrade I'm guessing.
Really can't find a solution on the forums etc.
But 8.2.1 includes that update by default right, so it should have worked already? Prior to updating to version 220.127.116.11 this install was updated to 5.8.0.x . Could that make the difference?
No luck by trying it manually with the sql dump. Is there a way to run the updates again (without resetting all data)?
This worked for me:
run in database SET FOREIGN_KEY_CHECKS=0;
Commandline: concrete/bin/concrete5 orm:schema-tool:update --dump-sql
Copy paste all the output and run it in the database.
run in database SET FOREIGN_KEY_CHECKS=1;
(( paste exception ended with semicolon between sets, remember exception is between single quoted ))
then refresh [http://yourdomain/index.php/ccm/system/upgrade]
and if other exception occurs replay it with new paste.