有時,當我們把在後端的訂單 - 與新客戶,我們在提交它收到以下錯誤:的Magento - 訂單節約錯誤:SQLSTATE [23000]:完整性約束衝突
Order saving error: SQLSTATE[23000]: Integrity constraint violation: 1452
Cannot add or update a child row: a foreign key constraint fails
`artizara_artizara/enterprise_reward`, CONSTRAINT `FK_REWARD_CUSTOMER_ID`
FOREIGN KEY (`customer_id`) REFERENCES customer_entity` (`entity_id`)
ON DELETE CASCADE ON UPDATE CASCADE)
我「已經擡頭錯誤日誌和它說以下內容:
exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint
violation: 1452 Cannot add or update a child row: a foreign key constraint fails
(`artizara_artizara/enterprise_reward`, CONSTRAINT `FK_REWARD_CUSTOMER_ID`
FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE
CASCADE ON UPDATE CASCADE)' in /chroot/home/artizara/artizara.com/html/lib/Zend/Db/Statement/Pdo.php:228
我在谷歌/ Magento的論壇研究這一點,有人說它與表不是InnobDB做...
所以我去了進入phpMyAdmin並拉起enterprise_reward
表。打開操作選項卡。它旁邊存儲引擎它說InnoDB,所以我認爲我設置了那裏...
其他人試圖通過搜索孤兒數據爲他們的問題的SQL語句。我不太清楚這是在尋找什麼,所以我不知道如何把sql語句放在一起(無論如何我都有點新)。
有人請幫助解決這個問題(通過搜索孤兒數據等),也許讓我知道爲什麼這首先發生?我們不能給我一個清晰的圖片,看看是否每個新客戶都會發生這種情況(在管理員處下訂單時)或僅僅是 - 所以我沒有那個信息(還沒有).. 。
編輯5/16 @ 2:30P:
我試圖尋找這個SQL代碼孤兒,但沒有結果返回 ...
SELECT
*
FROM
enterprise_reward
LEFT
JOIN
customer_entity
ON enterprise_reward.customer_id = customer_entity.entity_id
WHERE
customer_entity.entity_id IS NULL
如果您使用的企業版,我會建議提交支持票與Varien。並不是說這裏的某個人不會幫助你,但支持是你付出的一部分。 –
在我看來,我認爲發生的事情是系統在客戶在系統中創建之前試圖給予客戶獎勵。 –
http://seanbreeden.com/post/14693198343/fk-reward-customer-id-foreign-key-error-in-magento可能會有幫助,但直接勸阻編譯內核,只是轉移到本地來代替。 – B00MER