Fixing SQL Error 1072 with Customer Group ID Column
How to Fix the "Syntax error or access violation: 1072 Key column 'customer_group_id' doesn't exist in table" issue?
The outlined error is related to the amasty_groupcat_rule_product table, which is used by the Customer Group Catalog extension and serves as an index table. Data gets written into it only after performing a full Magento reindex. However, some issues may occur when the structure of this table is corrupted or doesn’t match the extension’s expectations, for example, if the customer_group_id column is missing.
To fix the error, follow these steps:
Step 1. Create DB backups;
Step 2. Run the following SQL query:
DROP TABLE amasty_groupcat_rule_product
Step 3. Execute these commands, from your Magento root folder via CLI:
The actual configuration and rules are stored in the amasty_groupcat_ruletable, so you will not lose them. And theamasty_groupcat_rule_product table will automatically be recreated with the proper structure during setup:upgrade.
Should you have any questions or require assistance, reach out to our support team - we're happy to help.