Skip to content

Fix for 'Integrity constraint violation: 1062 Duplicate entry '11-general' for key' #929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: 2.4-develop
Choose a base branch
from

Conversation

OliverRC
Copy link

@OliverRC OliverRC commented Jul 4, 2025

Description

Resolves the way custom groups are migrated from Magento 1 to Magento 2.

Does away with the previous method of trying to find the default, non-product group logic which attempted to use the initialData to see what were the defaults.

The problem was that it did not take into account the remapping of entity types and attribute sets and so was looking up Magento 1 groups on Magento 2 by attributeSetId which would have been changed.

This leads to it bugging and thinking some default groups need to be added as "custom groups" but this clashes with previous migration work that already remapped groups.

Fixed Issues (if relevant)

  1. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '11-general' for key 'EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_CODE' #869
  2. Integrity constraint violation: 1062 Duplicate entry '11-general' for key #928
  3. SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '11' for key 'PRIMARY' #920

Manual testing scenarios

  1. Try migrate Magento 1 data that contains the "General" attribute group associated with an attribute set for the entity types [11 , 16 , 23, 19]

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • README.md file is updated and included in the pull request if any README.md predefined sections require an update

@OliverRC OliverRC marked this pull request as ready for review July 4, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant