Opened 19 years ago
Closed 19 years ago
#1031 closed enhancement (worksforme)
Add some notes so mysql users can use ForeignKey fields
Reported by: | chmod | Owned by: | Jacob |
---|---|---|---|
Component: | Documentation | Version: | |
Severity: | major | Keywords: | mysql innodb foreignkey |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
ForeignKey fields will not work on 4.0.x version of mysql unless the default the table engine is InnoDB. And mysql will
silently let django-admin's create table queries run. You just won't get any nice relational methods in your app.
This causes the Poll, Choice example to make polls and choices fine, however, a Poll doesn't have the methods add_choice(),
get_choice(), etc...
Please add a note to the following page that explains to MySQL users that their default table type must be Innodb for ForeignKeys
to work properly.
Also can I just beg that we somehow have an option to django-admin or the meta.Model class that explicitly sets the engine type?
After all, explicit is better than implicit :)
Change History (3)
comment:1 by , 19 years ago
comment:2 by , 19 years ago
Ditto Eugene's comment; I've used Django with MySQL 4.x versions and MyISAM tables on a couple different servers, and it's worked fine, including the poll app as written up in the tutorial.
comment:3 by , 19 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Looks like this isn't a problem, judging from the comments.
I ran my app for months with MyISAM (the default engine of MySQL) with plenty of
ForeignKey
s in models. Are you sure it's not your setup problem?