0

I need help with that if i want to install module i get error after make command php bin/upgrade

SQLSTATE[HY000]: General error: 1826 Duplicate foreign key constraint name 'GHMZ_AMASTY_AMCHKT_FIELD_ATTR_ID_GHMZ_EAV_ATTR_ATTR_ID', query was: ALTER TABLE ghmz_amasty_amcheckout_field MODIFY COLUMN id smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT "Entity ID", MODIFY COLUMN attribute_id smallint(5) UNSIGNED NOT NULL COMMENT "EAV Attribute ID", MODIFY COLUMN sort_order smallint(6) NOT NULL COMMENT "Sort Order", MODIFY COLUMN width smallint(6) NOT NULL COMMENT "Width", MODIFY COLUMN store_id smallint(6) NOT NULL DEFAULT 0 COMMENT "Store Id", ADD CONSTRAINT GHMZ_AMASTY_AMCHKT_FIELD_ATTR_ID_GHMZ_EAV_ATTR_ATTR_ID FOREIGN KEY (attribute_id) REFERENCES ghmz_eav_attribute (attribute_id) ON DELETE CASCADE, DEFAULT CHARSET='utf8', DEFAULT COLLATE='utf8_general_ci'

asked Jan 20, 2024 at 6:10

1 Answer 1

0

Try to generate the db_schema_whitelist.json for that particular Moudle.

Below command will help you to generate the same file.

php bin/magento setup:db-declaration:generate-whitelist Vendor_ModuleName

After that check the etc folder of same module, there one file name : db_schema_whitelist.json will be generated.

After that run cache flush and then run the setup upgrade command.

answered Jan 22, 2024 at 7:14

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.