cancel
Showing results for 
Search instead for 
Did you mean: 

Upgrade from 2.2.7 to 2.4.1 SQLSTATE[23000]: Integrity constraint violation: 1452

Highlighted

Upgrade from 2.2.7 to 2.4.1 SQLSTATE[23000]: Integrity constraint violation: 1452

Hi  I am trying to upgrade from 2.2.4 to 2.4.1 and I get this error 

 

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`building_staging`.`#sql-dae_1904c`, CONSTRAINT `CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE), query was: ALTER TABLE `catalog_product_entity_decimal` MODIFY COLUMN `value` decimal(20, 6) NULL COMMENT "Value", ADD CONSTRAINT `CAT_PRD_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE, ADD CONSTRAINT `CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE, ADD CONSTRAINT `CATALOG_PRODUCT_ENTITY_DECIMAL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `store` (`store_id`) ON DELETE CASCADE

 

ive looked all over online and found little in the way of answers any help please?

 

thanks 

1 REPLY 1
Highlighted

Re: Upgrade from 2.2.7 to 2.4.1 SQLSTATE[23000]: Integrity constraint violation: 1452

Hello @m5solutions ,

 

This error says, that the database is unable to write something to a table

its means that there is a foreign key that is not satisfied (ie you need it to exist but it doesn't)

catalog_product_entity must have an entry for entity_id which is  referenced.

 

Thank You