0

I just upgrade to Magento 2.3.3 from Magento 2.2.9 following these steps (https://magento.stackexchange.com/questions/251778/how-to-upgrade-magento-version-from-2-2-x-to-2-3-0). However, at the step

php bin/magento setup:upgrade

i got the error message below

SQLSTATE[23000]: Integrity constraint violation: 1022 Can't write; duplicate key in table '#sql-1767_f1786', query was: ALTER TABLE catalog_product_entity_text MODIFY COLUMN value_id int(11) NOT NULL AUTO_INCREMENT COMMENT "Value ID", ADD CONSTRAINT PRIMARY KEY (value_id), ADD CONSTRAINT CAT_PRD_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR_ID FOREIGN KEY (attribute_id) REFERENCES eav_attribute (attribute_id) ON DELETE CASCADE, ADD CONSTRAINT CAT_PRD_ENTT_TEXT_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_TEXT_STORE_ID_STORE_STORE_ID FOREIGN KEY (store_id) REFERENCES store (store_id) ON DELETE CASCADE, ADD CONSTRAINT CATALOG_PRODUCT_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID UNIQUE KEY (entity_id,attribute_id,store_id), ADD INDEX CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE_ID (attribute_id), ADD INDEX CATALOG_PRODUCT_ENTITY_TEXT_STORE_ID (store_id)

1 Answer 1

0

commenting out the constraints in the following database schema file works.

file location: /vendor/magento/module-catalog/etc/db_schema.xml

cause: due to csv import, all the import columns got assigned to same value_id 0

solution: comment out line 153-169: comment out all the constraints for 'catalog_product_entity_text' table.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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