Description
Setup update error while updating older notso module:
SQLSTATE[42000]: Syntax error or access violation: 1068 Multiple primary key defined, query was: ALTER TABLE `nosto_tagging_customer` MODIFY COLUMN `customer_id` int UNSIGNED NULL COMMENT "Customer ID", MODIFY COLUMN `quote_id` int UNSIGNED NOT NULL , MODIFY COLUMN `nosto_id` varchar(255) NOT NULL COMMENT "Nosto Customer ID", MODIFY COLUMN `restore_cart_hash` text NULL COMMENT "Restore Cart Hash", ADD COLUMN `id` int UNSIGNED NOT NULL AUTO_INCREMENT COMMENT "ID", AUTO_INCREMENT = 375690, ADD CONSTRAINT PRIMARY KEY (`id`), ADD INDEX `NOSTO_TAGGING_CUSTOMER_QUOTE_ID` (`quote_id`), COMMENT='Nosto Tagging Customer', DEFAULT CHARSET='utf8', DEFAULT COLLATE='utf8_general_ci'
How to reproduce
Have old version of module installed in my case 5.2.1
Update code version to 7.3.1
Run bin/magento setup:upgrade
Magento 2 mode
[X] Developer
[X] Production
Full page cache
[X] Enabled
[X] Disabled
Nosto indexer mode
[ ] Update On Save
[X] Update By Schedule
Possible Solution
Generate db_schema_whitelist for the module:
bin/magento setup:db-declaration:generate-whitelist --module-name Nosto_Tagging
The generated file should be included in this repo.
Magento 2 version(s) used: 2.4.6 Extension version(s) affected: 7.3.1
Description
Setup update error while updating older notso module:
How to reproduce
Magento 2 mode
Full page cache
Nosto indexer mode
Possible Solution
Generate db_schema_whitelist for the module: bin/magento setup:db-declaration:generate-whitelist --module-name Nosto_Tagging The generated file should be included in this repo.