yii null foreign key

孤者浪人 提交于 2019-12-04 18:13:59
Rafay Zia Mir

This error can occur due to some reasons as mentioned below
1. Data Types may not be the same for fk and pk.
2. Size may not be the same of fk and pk
3. type may be different like unsigned, binary,unsigned binary and null
4. The value you are trying to put in city does not occur in area table

This is because you relation doesn't allow NULL values in the column. You have to edit the specific column, and check the empty checkbox. Then MySQL will allow NULL values.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!