Skip to content
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

Schema update failure: Duplicated key name #41

Open
almeidarobertop opened this issue Oct 20, 2023 · 2 comments
Open

Schema update failure: Duplicated key name #41

almeidarobertop opened this issue Oct 20, 2023 · 2 comments

Comments

@almeidarobertop
Copy link

When upgrading module from 1.2.9.1 to 2.0.0 we faced an error with duplicate key name.
image

Preconditions

Adobe Cloud

Magento Version :
Commerce 2.4.6-p3

Module Retailer Version :
1.2.9.1

Environment :
Production

Third party modules :
no

Steps to reproduce

1. Composer update smile/module-retailer
2. bin/magento setup:upgrade

Expected result

1. Complete setup with no error

Actual result

1. SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key name 'SMILE_RETAILER_ADDRESS_RETAILER_ID', query was: ALTER TABLE smile_retailer_address ADD CONSTRAINT SMILE_RETAILER_ADDRESS_RETAILER_ID UNIQUE KEY (retailer_id)
2.
image

@sylvester-c
Copy link

I faced this same issue, any solution for this?

@sylvesterdacosta
Copy link

The solution for this is before upgrade use this command:

ALTER TABLE smile_retailer_address
DROP FOREIGN KEY SMILE_RETAILER_ADDRESS_RETAILER_ID_SMILE_SELLER_ENTITY_ENTITY_ID,
DROP INDEX SMILE_RETAILER_ADDRESS_RETAILER_ID;

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

No branches or pull requests

3 participants