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

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

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

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form