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'
1 Answer 1
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.