-
Notifications
You must be signed in to change notification settings - Fork 642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[5.x]: After Update Migration with foreign_key constraint of matrix blocks fails integrity constraint violation #14839
Comments
It sounds like you may have some orphaned data in your install. Can you try running If you get the error again, we can help look into it further if you can send your database backup over to [email protected]. |
Today Same Problem from 4.9.2 to 5.1.2 -> i send a Mail with additional Information (Mainly the Database Dump)
|
For reference: Thanks Simon. There are some orphaned blocks in your DB causing the problem. Those are there because some of you your DB table are missing their foreign keys. Starting on your Craft 4 site, first, install this plugin and run it from Utilities → Fix FKs. Next, to delete the blocks, run DELETE FROM craft_matrixblocks WHERE id NOT IN (SELECT id FROM craft_elements). You can now composer update to Craft 5 then php craft migrate/all, and the update will work. Let me know if that helps and we'll close the issue :) |
@LeoWie93 please close the issue |
What happened?
Description
We are trying to run the Database Migrations after Upgrading a Project to Craft 5.
Steps to reproduce
Expected behavior
The migration runs without an error. => succesfully migrates matrix blocks
Actual behavior
Craft CMS version
5.0.x
PHP version
8.2
Operating system and version
Linux
Database type and version
Mysql 8.0.36
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: