Magento - 诚信约束viloation:1452,购物车规则

时间:2013-05-14 20:41:44

标签: mysql sql magento

在为给定类别或SKU编号制定折扣/购物车规则时,无法保存并创建此错误:

'Zend_Db_Statement_Exception' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`shop1`.`salesrule_product_attribute`, CONSTRAINT `FK_SALESRULE_PRD_ATTR_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_i)' in /var/www/shop1/public_html/lib/Zend/Db/Statement/Pdo.php:234

我一直在通过我的数据库查找问题,但没有运气。我不确定从哪里开始查看,我发现customer_group表中没有明显错误,但我认为这与删除的商店前端有关,前一段时间,maby弄乱了客户ID?

1 个答案:

答案 0 :(得分:2)

当然最明显的原因是我检查的最后一个! - 'customer_group'表设置为MyISAM而不是InnoDB,必须是InnoDB。