FOREIGN KEY problem on Packages

Permalink
When trying to install a package, I get errors like this one:

An exception occurred while executing 'ALTER TABLE AttributeSets ADD CONSTRAINT FK_FCA02D5FCE45CBB0 FOREIGN KEY (pkgID) REFERENCES Packages (pkgID)': SQLSTATE[23000]: 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.

Dutchwave
View Replies:
JohntheFish replied on at Permalink Reply
JohntheFish
Dutchwave replied on at Permalink Reply
Dutchwave
Thanks.
But 8.2.1 includes that update by default right, so it should have worked already? Prior to updating to version 5.8.2.1 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)?
Dutchwave replied on at Permalink Reply
Dutchwave
Allright finally figured out what he meant.
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;