Magento迁移外键错误

时间:2014-08-21 20:50:17

标签: magento

我目前正在升级Magento,我似乎已经解决了这个问题:

a:5:{i:0;s:211:"Error in file: "app/code/core/Mage/Catalog/sql/catalog_setup/upgrade-1.6.0.0.9-1.6.0.0.10.php" - SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint";i:1;s:1132:"#0 app/code/core/Mage/Core/Model/Resource/Setup.php(645): Mage::exception('Mage_Core', 'Error in file: ...')
#1 app/code/core/Mage/Core/Model/Resource/Setup.php(437): Mage_Core_Model_Resource_Setup->_modifyResourceDb('upgrade', '1.6.0.0.9', '1.6.0.0.19')
#2 app/code/core/Mage/Core/Model/Resource/Setup.php(320): Mage_Core_Model_Resource_Setup->_upgradeResourceDb('1.6.0.0.9', '1.6.0.0.19')
#3 app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 app/code/core/Mage/Core/Model/App.php(417): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 app/code/core/Mage/Core/Model/App.php(343): Mage_Core_Model_App->_initModules()
#6 app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 index.php(87): Mage::run('', 'store')
#8 {main}";s:3:"url";s:1:"/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"default";}

最新的外键错误

2014-08-21 15:52:14 1ae404000 Error in foreign key constraint of table magento/catalog_product_entity_group_price:
FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_CAT_PRD_ENTT_GROUP_PRICE_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `FK_CAT_PRD_ENTT_GROUP_PRICE_WS_ID_CORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) COMMENT='Catalog Product Group Price Attribute Backend Table' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci:
Cannot resolve table name close to:
(`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CAT_PRD_ENTT_GROUP_PRICE_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CAT_PRD_ENTT_GROUP_PRICE_WS_ID_CORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) COMMENT='Catalog Product Group Price Attribute Backend Table' ENGINE=INNODB charset=utf8 COLLATE=utf8_general_ci

任何帮助将不胜感激。

1 个答案:

答案 0 :(得分:0)

从MyISAM到InnoDB的切换表引擎解决了这个问题。