首页 > 解决方案 > 一般错误:1822 无法添加外键约束

问题描述

我正在将我们的 Magento 2.3.3 移动到开发服务器,这样我就可以继续开发它并升级到 2.4 我已经移动了所有东西,但是当我运行 php bin/magento setup:upgrade 命令时,我收到了这个错误:

Updating modules:
Schema creation/updates:
SQLSTATE[HY000]: General error: 1822 Failed to add the foreign key constaint. Missing index for constraint 'STORE_GROUP_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID' in the referenced table 'store_website', query was: ALTER TABLE `store_group` ADD CONSTRAINT `STORE_GROUP_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `store_website` (`website_id`)  ON DELETE CASCADE

不知道在这里做什么。

标签: magento2magento-2.3

解决方案


推荐阅读