setup:upgrade SQL error after update from 2.2.8 to 2.3.1Magento 2.3 setup:upgrade error sqlMagento 2.3.1 installation ErrorMagento 2.3.1 Error on checkout getAdditionalInformation()MsrpPriceCalculator exception after upgrade to 2.3.1setup:upgrade error for queryHow to update magento 2.3.0 to 2.3.1 in cloudbin/magento error after updateCan't access admin after update Magento 2.3.1Magento 2.3.1 update issueUpgrade to 2.3.1 from 2.2.7 fails on setup:upgrade

Looking after a wayward brother in mother's will

Windows 10 Programs start without visual Interface

How is character development a major role in the plot of a story

Why doesn't the Earth's acceleration towards the Moon accumulate to push the Earth off its orbit?

Inverter Power draw from 12V battery

What is the 中 in ダウンロード中?

Can a non-EU citizen travel within schengen zone freely without passport?

Draw a checker pattern with a black X in the center

Apparent Ring of Craters on the Moon

What are these (utility?) boxes at the side of the house?

What is the most important source of natural gas? coal, oil or other?

Is it ok to put a subplot to a story that is never meant to contribute to the development of the main plot?

Crossword gone overboard

Comment dit-on « I’ll tell you what » ?

What does uniform continuity mean exactly?

How many chess players are over 2500 Elo?

Is CD audio quality good enough for the final delivery of music?

The Passive Wisdom (Perception) score of my character on D&D Beyond seems too high

What does it mean when you think without speaking?

How to capture more stars?

Split polygon using another polygon in QGIS

Which noble houses were destroyed during the Game of Thrones?

Plot exactly N bounce of a ball

Why do they consider the Ori false gods?



setup:upgrade SQL error after update from 2.2.8 to 2.3.1


Magento 2.3 setup:upgrade error sqlMagento 2.3.1 installation ErrorMagento 2.3.1 Error on checkout getAdditionalInformation()MsrpPriceCalculator exception after upgrade to 2.3.1setup:upgrade error for queryHow to update magento 2.3.0 to 2.3.1 in cloudbin/magento error after updateCan't access admin after update Magento 2.3.1Magento 2.3.1 update issueUpgrade to 2.3.1 from 2.2.7 fails on setup:upgrade






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








6















What could be the reason for this error on bin/magento setup:upgrade after updating from 2.2.8 to 2.3.1?




SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key
name 'WISHLIST_CUSTOMER_ID', query was: ALTER TABLE wishlist ADD
CONSTRAINT WISHLIST_CUSTOMER_ID UNIQUE KEY (customer_id)




The db_schema.xml of the wishlist module contains this definition:



 <constraint xsi:type="unique" referenceId="WISHLIST_CUSTOMER_ID">
<column name="customer_id"/>
</constraint>


But it should not try to create the constraint if it is already there?



SHOW CREATE TABLE whishlist shows me:



CREATE TABLE `wishlist` (
`wishlist_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Wishlist ID',
`customer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer ID',
`shared` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Sharing flag (0 or 1)',
`sharing_code` varchar(32) DEFAULT NULL COMMENT 'Sharing encrypted code',
`updated_at` timestamp NULL DEFAULT NULL COMMENT 'Last updated date',
`name` varchar(255) DEFAULT NULL COMMENT 'Wish List Name',
`visibility` smallint(6) DEFAULT '0' COMMENT 'Wish List visibility type',
PRIMARY KEY (`wishlist_id`),
KEY `WISHLIST_SHARED` (`shared`),
KEY `WISHLIST_CUSTOMER_ID` (`customer_id`),
CONSTRAINT `WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=34412 DEFAULT CHARSET=utf8 COMMENT='Wishlist main Table'


The entry in the setup_module table:



+------------------+----------------+--------------+
| module | schema_version | data_version |
+------------------+----------------+--------------+
| Magento_Wishlist | 2.0.2 | 2.0.2 |
+------------------+----------------+--------------+









share|improve this question




























    6















    What could be the reason for this error on bin/magento setup:upgrade after updating from 2.2.8 to 2.3.1?




    SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key
    name 'WISHLIST_CUSTOMER_ID', query was: ALTER TABLE wishlist ADD
    CONSTRAINT WISHLIST_CUSTOMER_ID UNIQUE KEY (customer_id)




    The db_schema.xml of the wishlist module contains this definition:



     <constraint xsi:type="unique" referenceId="WISHLIST_CUSTOMER_ID">
    <column name="customer_id"/>
    </constraint>


    But it should not try to create the constraint if it is already there?



    SHOW CREATE TABLE whishlist shows me:



    CREATE TABLE `wishlist` (
    `wishlist_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Wishlist ID',
    `customer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer ID',
    `shared` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Sharing flag (0 or 1)',
    `sharing_code` varchar(32) DEFAULT NULL COMMENT 'Sharing encrypted code',
    `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Last updated date',
    `name` varchar(255) DEFAULT NULL COMMENT 'Wish List Name',
    `visibility` smallint(6) DEFAULT '0' COMMENT 'Wish List visibility type',
    PRIMARY KEY (`wishlist_id`),
    KEY `WISHLIST_SHARED` (`shared`),
    KEY `WISHLIST_CUSTOMER_ID` (`customer_id`),
    CONSTRAINT `WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE
    ) ENGINE=InnoDB AUTO_INCREMENT=34412 DEFAULT CHARSET=utf8 COMMENT='Wishlist main Table'


    The entry in the setup_module table:



    +------------------+----------------+--------------+
    | module | schema_version | data_version |
    +------------------+----------------+--------------+
    | Magento_Wishlist | 2.0.2 | 2.0.2 |
    +------------------+----------------+--------------+









    share|improve this question
























      6












      6








      6


      2






      What could be the reason for this error on bin/magento setup:upgrade after updating from 2.2.8 to 2.3.1?




      SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key
      name 'WISHLIST_CUSTOMER_ID', query was: ALTER TABLE wishlist ADD
      CONSTRAINT WISHLIST_CUSTOMER_ID UNIQUE KEY (customer_id)




      The db_schema.xml of the wishlist module contains this definition:



       <constraint xsi:type="unique" referenceId="WISHLIST_CUSTOMER_ID">
      <column name="customer_id"/>
      </constraint>


      But it should not try to create the constraint if it is already there?



      SHOW CREATE TABLE whishlist shows me:



      CREATE TABLE `wishlist` (
      `wishlist_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Wishlist ID',
      `customer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer ID',
      `shared` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Sharing flag (0 or 1)',
      `sharing_code` varchar(32) DEFAULT NULL COMMENT 'Sharing encrypted code',
      `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Last updated date',
      `name` varchar(255) DEFAULT NULL COMMENT 'Wish List Name',
      `visibility` smallint(6) DEFAULT '0' COMMENT 'Wish List visibility type',
      PRIMARY KEY (`wishlist_id`),
      KEY `WISHLIST_SHARED` (`shared`),
      KEY `WISHLIST_CUSTOMER_ID` (`customer_id`),
      CONSTRAINT `WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE
      ) ENGINE=InnoDB AUTO_INCREMENT=34412 DEFAULT CHARSET=utf8 COMMENT='Wishlist main Table'


      The entry in the setup_module table:



      +------------------+----------------+--------------+
      | module | schema_version | data_version |
      +------------------+----------------+--------------+
      | Magento_Wishlist | 2.0.2 | 2.0.2 |
      +------------------+----------------+--------------+









      share|improve this question














      What could be the reason for this error on bin/magento setup:upgrade after updating from 2.2.8 to 2.3.1?




      SQLSTATE[42000]: Syntax error or access violation: 1061 Duplicate key
      name 'WISHLIST_CUSTOMER_ID', query was: ALTER TABLE wishlist ADD
      CONSTRAINT WISHLIST_CUSTOMER_ID UNIQUE KEY (customer_id)




      The db_schema.xml of the wishlist module contains this definition:



       <constraint xsi:type="unique" referenceId="WISHLIST_CUSTOMER_ID">
      <column name="customer_id"/>
      </constraint>


      But it should not try to create the constraint if it is already there?



      SHOW CREATE TABLE whishlist shows me:



      CREATE TABLE `wishlist` (
      `wishlist_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Wishlist ID',
      `customer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer ID',
      `shared` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Sharing flag (0 or 1)',
      `sharing_code` varchar(32) DEFAULT NULL COMMENT 'Sharing encrypted code',
      `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Last updated date',
      `name` varchar(255) DEFAULT NULL COMMENT 'Wish List Name',
      `visibility` smallint(6) DEFAULT '0' COMMENT 'Wish List visibility type',
      PRIMARY KEY (`wishlist_id`),
      KEY `WISHLIST_SHARED` (`shared`),
      KEY `WISHLIST_CUSTOMER_ID` (`customer_id`),
      CONSTRAINT `WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE
      ) ENGINE=InnoDB AUTO_INCREMENT=34412 DEFAULT CHARSET=utf8 COMMENT='Wishlist main Table'


      The entry in the setup_module table:



      +------------------+----------------+--------------+
      | module | schema_version | data_version |
      +------------------+----------------+--------------+
      | Magento_Wishlist | 2.0.2 | 2.0.2 |
      +------------------+----------------+--------------+






      magento2.3 upgrade wishlist magento2.3.1 declarative-schema






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 22 at 9:42









      Fabian SchmenglerFabian Schmengler

      55.1k21142355




      55.1k21142355




















          1 Answer
          1






          active

          oldest

          votes


















          2














          Apparently it is a Magento bug. When comparing current schema to declared schema, constraints and other indexes are handled separately, but the existing index is not dropped before the new UNIQUE index is created.



          A workaround in this case is to drop or¹ rename the existing index in a separate script before performing the update.



          alter table wishlist rename index WISHLIST_CUSTOMER_ID to WISHLIST_CUSTOMER_ID_DELETE_ME;


          Not quite satisfying but does the job, as long as there's no solution for the core bug.



          Update: what actually triggered the bug was that the magento/module-multiple-wishlist module from Commerce/Enterprise Edition had been disabled. Re-enabling it also "solved" the issue.



          ¹) dropping it was not possible without also removing the foreign key that depends on it






          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%2f275628%2fsetupupgrade-sql-error-after-update-from-2-2-8-to-2-3-1%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









            2














            Apparently it is a Magento bug. When comparing current schema to declared schema, constraints and other indexes are handled separately, but the existing index is not dropped before the new UNIQUE index is created.



            A workaround in this case is to drop or¹ rename the existing index in a separate script before performing the update.



            alter table wishlist rename index WISHLIST_CUSTOMER_ID to WISHLIST_CUSTOMER_ID_DELETE_ME;


            Not quite satisfying but does the job, as long as there's no solution for the core bug.



            Update: what actually triggered the bug was that the magento/module-multiple-wishlist module from Commerce/Enterprise Edition had been disabled. Re-enabling it also "solved" the issue.



            ¹) dropping it was not possible without also removing the foreign key that depends on it






            share|improve this answer





























              2














              Apparently it is a Magento bug. When comparing current schema to declared schema, constraints and other indexes are handled separately, but the existing index is not dropped before the new UNIQUE index is created.



              A workaround in this case is to drop or¹ rename the existing index in a separate script before performing the update.



              alter table wishlist rename index WISHLIST_CUSTOMER_ID to WISHLIST_CUSTOMER_ID_DELETE_ME;


              Not quite satisfying but does the job, as long as there's no solution for the core bug.



              Update: what actually triggered the bug was that the magento/module-multiple-wishlist module from Commerce/Enterprise Edition had been disabled. Re-enabling it also "solved" the issue.



              ¹) dropping it was not possible without also removing the foreign key that depends on it






              share|improve this answer



























                2












                2








                2







                Apparently it is a Magento bug. When comparing current schema to declared schema, constraints and other indexes are handled separately, but the existing index is not dropped before the new UNIQUE index is created.



                A workaround in this case is to drop or¹ rename the existing index in a separate script before performing the update.



                alter table wishlist rename index WISHLIST_CUSTOMER_ID to WISHLIST_CUSTOMER_ID_DELETE_ME;


                Not quite satisfying but does the job, as long as there's no solution for the core bug.



                Update: what actually triggered the bug was that the magento/module-multiple-wishlist module from Commerce/Enterprise Edition had been disabled. Re-enabling it also "solved" the issue.



                ¹) dropping it was not possible without also removing the foreign key that depends on it






                share|improve this answer















                Apparently it is a Magento bug. When comparing current schema to declared schema, constraints and other indexes are handled separately, but the existing index is not dropped before the new UNIQUE index is created.



                A workaround in this case is to drop or¹ rename the existing index in a separate script before performing the update.



                alter table wishlist rename index WISHLIST_CUSTOMER_ID to WISHLIST_CUSTOMER_ID_DELETE_ME;


                Not quite satisfying but does the job, as long as there's no solution for the core bug.



                Update: what actually triggered the bug was that the magento/module-multiple-wishlist module from Commerce/Enterprise Edition had been disabled. Re-enabling it also "solved" the issue.



                ¹) dropping it was not possible without also removing the foreign key that depends on it







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 2 days ago

























                answered May 24 at 10:54









                Fabian SchmenglerFabian Schmengler

                55.1k21142355




                55.1k21142355



























                    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%2f275628%2fsetupupgrade-sql-error-after-update-from-2-2-8-to-2-3-1%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