0

Please help!!!!!! I am upgrading from 2.1.7 to ver 2.3.0 I am stuck. I am not sure how no one else has the same issue. nothing related to this table on any forum. I am unable to Truncate, Delete this table due Foreign key constraint. I tried to delete the customer_group table i get this ("Cannot delete or update a parent row: a foreign key constraint fails") when I Truncate I get this message ("Cannot truncate a table referenced in a foreign key constraint (aayebmfmry.catalog_product_bundle_price_index, CONSTRAINT catalog_product_bundle_price_index_ibfk_1 FOREIGN KEY (customer_group_id) REFERENCES aayebmfmry.customer_group (`customer_"

luckily this is a staging environment, so I have done upgrade couple times and I cannot get past this nightmare table.

after removing some old modules and updating it to php 7.1 - the upgrades goes smoothly and the next step is (php bin/magento setup:upgrade) This is the message i get....

Foreign key constraint is incorrectly formed), query was: ALTER TABLE customer_group MODIFY COLUMN customer_group_id int(10) UNSIGNED NOT NULL AUTO_INCREMENT

This option doesnt really work...no table are effected when i run this query

SET FOREIGN_KEY_CHECKS = 0; 
TRUNCATE table customer_group; 
SET FOREIGN_KEY_CHECKS = 1;
5
  • run it on mysql CLI
    – fmsthird
    Mar 6, 2019 at 0:43
  • I am using CLI..a terminal service (SSH)
    – roger
    Mar 6, 2019 at 0:51
  • make sure the user has the right permission to modify your schema
    – fmsthird
    Mar 6, 2019 at 5:31
  • as far as i know I am a super user -
    – roger
    Mar 6, 2019 at 13:59
  • do you have phpMyadmin or any database gui? If yes, maybe try to run it on its SQL query interface and check if you still got the same error
    – fmsthird
    Mar 7, 2019 at 4:08

1 Answer 1

0

I faced the same issue upgrading from 2.1.9 to 2.3.1

The issue was given by customer_group_id that was used as foreign key on a table of a 3rd part module.

I solved removing the tables of that module that were unused and running again
bin/magento setup:upgrade

Hope it helps

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.