Magento 2 - 违反完整性约束。1062 重复条目 - 从社区升级到企业后,在setup:upgrade中出现的错误

问题描述 投票:0回答:1

我通过composer升级到企业版2.3.5-p1。

现在我在执行了 bin/magento setup:upgrade:

...
Module 'Magento_GiftMessage':
Module 'Magento_GiftMessageStaging':
Module 'Magento_UrlRewrite':
Module 'Magento_GiftWrapping':
Unable to apply data patch Magento\GiftWrapping\Setup\Patch\Data\GiftOptionsAttributes for module Magento_GiftWrapping. Original exception message: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '9-Gift Options' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME', query was: INSERT INTO `eav_attribute_group` (`attribute_set_id`, `attribute_group_name`, `sort_order`, `attribute_group_code`) VALUES (?, ?, ?, ?)

我在找 9-礼品选择 在phpMyAdmin的搜索功能中,但我得到0个结果。

如何解决这个问题?

mysql sql database magento2
1个回答
0
投票

我必须在phpmyadmin中打开表 "eav_attribute_group"。然后,我选择了 "结构",看着 "Indizes"。

enter image description here

如你所见 EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME. 设置为唯一,并以列的方式构建。属性设置_id - 属性组名称.

于是我搜索了一下重复的密钥,然后删除了它。

SELECT * FROM `eav_attribute_group` WHERE `attribute_set_id` = 9 AND `attribute_group_name` = "Gift Options"
© www.soinside.com 2019 - 2024. All rights reserved.