0

I have upgraded from Magento2.2.10 to Magento2.3.3

after running

php bin/magento setup:upgrade

I got this error

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (db_amit.#sql-14b6_7ed, 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

0

You should check in the table catalog_product_entity_decimal, are there any col which has entity_id = no exist in table catalog_product_entity?

Please run this query:

select * from catalog_product_entity_decimal where entity_id not in (select entity_id from catalog_product_entity)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.