开发者

Magento Model with Foreign Key Constraint

I am trying to create a model in my module that开发者_开发百科 saves data and links against the customer_entity table. I have got the module saving the model without the foreign key constraint but as soon as I alter the table to include the constraint I get an integrity constraint violation exception even though I am including a customer id that exists in the customer_entity table.

Is there something extra I need to do with my model class or model resource class to get the model saving correctly?


There's too many things that could be a mitigating factor here. At some point Magento is running some set of SQL queries that temporarily (or possibly permanently) cause a foreign key constraint. The only way to solve this is to drop down below the Model layer and look at the actual SQL being run against your database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜