Skip to content

Duplicate eav_attribute_option_value error when upgrading Magento from 2.4.6 to 2.4.8

After running composer update to Magento 2.4.8 and then executing the upgrade command, I get the following error message.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘0-5’ for key ‘EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_OPTION_ID’, query was: ALTER TABLE eav_attribute_option_value MODIFY COLUMN value varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT “Value”, ADD CONSTRAINT EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_OPTION_ID UNIQUE KEY (store_id,option_id), DEFAULT CHARSET=’utf8mb4′, DEFAULT COLLATE=’utf8mb4_general_ci’