开发者

Make Django Create Foreign Keys for MySQL Backend

How do you force Django to create real foreign key constraints when using a MySQL backend? If I'm reading this old bug report correctly, Django shou开发者_JS百科ld be creating real foreign keys, but my default Django 1.2.3 setup using MySQL only generates indexes for models.ForeignKey().


Change your database engine to InnoDB. MyISAM doesn't support foreign keys.


I'm running on Django 1.2.1 with MySQL_python-1.2.3c and can verify that it is indeed creating proper foreign key entries on MySQL.

I suggest that you check if you are using MySQL_python-1.2.3c or better

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜