I am getting the below error when i trying to run setup upgrade command.

SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key, query was: ALTER TABLE `catalog_product_index_price_tmp` MODIFY COLUMN `entity_id` int UNSIGNED NOT NULL   COMMENT "Entity ID", DROP PRIMARY KEY, ADD CONSTRAINT  PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`), ADD INDEX `CATALOG_PRODUCT_INDEX_PRICE_TMP_CUSTOMER_GROUP_ID` (`customer_group_id`), ADD INDEX `CATALOG_PRODUCT_INDEX_PRICE_TMP_WEBSITE_ID` (`website_id`), ADD INDEX `CATALOG_PRODUCT_INDEX_PRICE_TMP_MIN_PRICE` (`min_price`), DEFAULT CHARSET='utf8', DEFAULT COLLATE='utf8_general_ci'

This is the structure of table catalog_product_index_price_tmp

enter image description here

Please let me know if you have any idea , how to fix this issue. Thanks.

  • are you trying to modify this table or this is something you receive when you run setup: upgrade? Sep 25, 2023 at 9:51

1 Answer 1


You can delete this temp table "catalog_product_index_price_tmp".

It will automatically created after run commands.

Note : Take database backup before doing operation.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.