When the m240115_000000_craft5.php migration runs, I'm presented with the following error:
Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (craftcms.craft_entries, CONSTRAINT craft_entries_id_fk FOREIGN KEY (id) REFERENCES craft_elements (id) ON DELETE CASCADE)
As best I can tell, this happens as I have stray supertable blocks (blocks without a corresponding element). I've assumed each block is supposed to have a corresponding element and have checked some are missing by running:
select s.id from craft_supertableblocks s
left join craft_elements e on s.id = e.id
where e.id is null;
I just thought I'd raise an issue in case anyone else is having the same problem and also to confirm my assumptions above are correct. If they are, presumably the fix is to simply delete them as they wont be in use anyway?
Steps to reproduce
Install V4
Upgrade to craft 5
Run the craft up command
Craft CMS version
5
Plugin version
4
Multi-site?
No response
Additional context
I also have neo blocks installed and had a similar issue.
Describe the bug
When the
m240115_000000_craft5.php
migration runs, I'm presented with the following error:Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (
craftcms
.craft_entries
, CONSTRAINTcraft_entries_id_fk
FOREIGN KEY (id
) REFERENCEScraft_elements
(id
) ON DELETE CASCADE)As best I can tell, this happens as I have stray supertable blocks (blocks without a corresponding element). I've assumed each block is supposed to have a corresponding element and have checked some are missing by running:
I just thought I'd raise an issue in case anyone else is having the same problem and also to confirm my assumptions above are correct. If they are, presumably the fix is to simply delete them as they wont be in use anyway?
Steps to reproduce
Craft CMS version
5
Plugin version
4
Multi-site?
No response
Additional context
I also have neo blocks installed and had a similar issue.