«1062 Duplicate entry '3-' for key 'CATALOG_CATEGORY_PRODUCT_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE', query was: ALTER TABLE `eav_attribute_group` MODIFY COLUMN `attribute_group_code` varchar(255) NOT NULL COMMENT "Attribute Group Code"» in Magento 2.3

setup:upgrade
bug
bug-fix
magento23

(Dmitry Fedyuk) #1

01

Updating modules:
Schema creation/updates:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘3-’ for key ‘CATALOG_CATEGORY_PRODUCT_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE’, query was: ALTER TABLE eav_attribute_group MODIFY COLUMN attribute_group_code varchar(255) NOT NULL COMMENT “Attribute Group Code”


(Dmitry Fedyuk) #2

The previous declaration was:

`attribute_group_code` varchar(255) DEFAULT NULL COMMENT 'Attribute Group Code'

(Dmitry Fedyuk) #3

02


(Dmitry Fedyuk) #4

How to fix

UPDATE eav_attribute_group
 	SET attribute_group_code = 'display-settings' WHERE attribute_group_name = 'Display Settings'
;
UPDATE eav_attribute_group
 	SET attribute_group_code = 'custom-design' WHERE attribute_group_name = 'Custom Design'
;
UPDATE eav_attribute_group
 	SET attribute_group_code = 'general' WHERE attribute_group_name = 'General'
;
UPDATE eav_attribute_group
 	SET attribute_group_code = 'general-information' WHERE attribute_group_name = 'General Information'
;
UPDATE eav_attribute_group
 	SET attribute_group_code = 'diary' WHERE attribute_group_name = 'Молочные продукты'
;