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;
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 TABLEwishlist
ADD
CONSTRAINTWISHLIST_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
add a comment |
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 TABLEwishlist
ADD
CONSTRAINTWISHLIST_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
add a comment |
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 TABLEwishlist
ADD
CONSTRAINTWISHLIST_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
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 TABLEwishlist
ADD
CONSTRAINTWISHLIST_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
magento2.3 upgrade wishlist magento2.3.1 declarative-schema
asked May 22 at 9:42
Fabian SchmenglerFabian Schmengler
55.1k21142355
55.1k21142355
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
edited 2 days ago
answered May 24 at 10:54
Fabian SchmenglerFabian Schmengler
55.1k21142355
55.1k21142355
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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