Foreign key constraint is incorrectly formed after upgrade to 2.3.0 The 2019 Stack Overflow Developer Survey Results Are InCan't reindex Product Prices: a foreign key constraint failsError on foreign keyMagento 2 : Upgrade Script Alter Column with Foreign Key via APIMagento 2 Insert data to table that contain foreign key error SQLSTATE[23000]: Integrity constraint violationForeign key constraint fails Entity_Type_IDHow to handle `catalog_product_entity` foreign key constraint while migrating M1 to M2Cannot add or update a child row: a foreign key constraint failsMagento 2: foreign key for catalog_product_entityForeign key constraint failsMagento 2 : Foreign key constraint is incorrectly formed, ALTER TABLE customer_group

Why not take a picture of a closer black hole?

If I score a critical hit on an 18 or higher, what are my chances of getting a critical hit if I roll 3d20?

How to charge AirPods to keep battery healthy?

Kerning for subscripts of sigma?

Worn-tile Scrabble

What does Linus Torvalds mean when he says that Git "never ever" tracks a file?

How to translate "being like"?

Variable with quotation marks "$()"

Can there be female White Walkers?

Can a flute soloist sit?

Is it ok to offer lower paid work as a trial period before negotiating for a full-time job?

Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?

Are spiders unable to hurt humans, especially very small spiders?

Is there a way to generate a uniformly distributed point on a sphere from a fixed amount of random real numbers?

A female thief is not sold to make restitution -- so what happens instead?

Cooking pasta in a water boiler

ELI5: Why they say that Israel would have been the fourth country to land a spacecraft on the Moon and why they call it low cost?

What do I do when my TA workload is more than expected?

Will it cause any balance problems to have PCs level up and gain the benefits of a long rest mid-fight?

Why can't devices on different VLANs, but on the same subnet, communicate?

How do PCB vias affect signal quality?

What do these terms in Caesar's Gallic Wars mean?

A word that means fill it to the required quantity

Did the UK government pay "millions and millions of dollars" to try to snag Julian Assange?



Foreign key constraint is incorrectly formed after upgrade to 2.3.0



The 2019 Stack Overflow Developer Survey Results Are InCan't reindex Product Prices: a foreign key constraint failsError on foreign keyMagento 2 : Upgrade Script Alter Column with Foreign Key via APIMagento 2 Insert data to table that contain foreign key error SQLSTATE[23000]: Integrity constraint violationForeign key constraint fails Entity_Type_IDHow to handle `catalog_product_entity` foreign key constraint while migrating M1 to M2Cannot add or update a child row: a foreign key constraint failsMagento 2: foreign key for catalog_product_entityForeign key constraint failsMagento 2 : Foreign key constraint is incorrectly formed, ALTER TABLE customer_group



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








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;









share|improve this question






















  • run it on mysql CLI

    – magefms
    Mar 6 at 0:43











  • I am using CLI..a terminal service (SSH)

    – roger
    Mar 6 at 0:51











  • make sure the user has the right permission to modify your schema

    – magefms
    Mar 6 at 5:31











  • as far as i know I am a super user -

    – roger
    Mar 6 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

    – magefms
    Mar 7 at 4:08

















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;









share|improve this question






















  • run it on mysql CLI

    – magefms
    Mar 6 at 0:43











  • I am using CLI..a terminal service (SSH)

    – roger
    Mar 6 at 0:51











  • make sure the user has the right permission to modify your schema

    – magefms
    Mar 6 at 5:31











  • as far as i know I am a super user -

    – roger
    Mar 6 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

    – magefms
    Mar 7 at 4:08













0












0








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;









share|improve this question














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;






foreign-key






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 5 at 21:49









rogerroger

161216




161216












  • run it on mysql CLI

    – magefms
    Mar 6 at 0:43











  • I am using CLI..a terminal service (SSH)

    – roger
    Mar 6 at 0:51











  • make sure the user has the right permission to modify your schema

    – magefms
    Mar 6 at 5:31











  • as far as i know I am a super user -

    – roger
    Mar 6 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

    – magefms
    Mar 7 at 4:08

















  • run it on mysql CLI

    – magefms
    Mar 6 at 0:43











  • I am using CLI..a terminal service (SSH)

    – roger
    Mar 6 at 0:51











  • make sure the user has the right permission to modify your schema

    – magefms
    Mar 6 at 5:31











  • as far as i know I am a super user -

    – roger
    Mar 6 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

    – magefms
    Mar 7 at 4:08
















run it on mysql CLI

– magefms
Mar 6 at 0:43





run it on mysql CLI

– magefms
Mar 6 at 0:43













I am using CLI..a terminal service (SSH)

– roger
Mar 6 at 0:51





I am using CLI..a terminal service (SSH)

– roger
Mar 6 at 0:51













make sure the user has the right permission to modify your schema

– magefms
Mar 6 at 5:31





make sure the user has the right permission to modify your schema

– magefms
Mar 6 at 5:31













as far as i know I am a super user -

– roger
Mar 6 at 13:59





as far as i know I am a super user -

– roger
Mar 6 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

– magefms
Mar 7 at 4:08





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

– magefms
Mar 7 at 4:08










1 Answer
1






active

oldest

votes


















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






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f264581%2fforeign-key-constraint-is-incorrectly-formed-after-upgrade-to-2-3-0%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    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






    share|improve this answer



























      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






      share|improve this answer

























        0












        0








        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






        share|improve this answer













        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







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        Daniele RovattiDaniele Rovatti

        8910




        8910



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f264581%2fforeign-key-constraint-is-incorrectly-formed-after-upgrade-to-2-3-0%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?