#14536 closed (fixed)
Incorrect syntax about using OPTIONS for changing the database engine
| Reported by: | Denilson Figueiredo de Sá | Owned by: | nobody |
|---|---|---|---|
| Component: | Documentation | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Right here: http://docs.djangoproject.com/en/dev/ref/databases/#creating-your-tables
We have the following code:
OPTIONS = {
"init_command": "SET storage_engine=INNODB",
}
Which is not using the dict syntax. The correct would be:
'OPTIONS': {
'init_command': 'SET storage_engine=INNODB',
},
(as bonus, to avoid confusion, replaced double-quotes with single-quotes, as they are the type of quotation used by default in settings.py)
A little off-topic, but it says we should remove that line after we create the tables. Why? A little explanation would help. Why can't we just leave it there? (so it will work whenever we need to re-create the tables)
Change History (3)
comment:1 by , 15 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:2 by , 15 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
I presume the reason it's recommended to remove it is that you don't need (or want) it trying to set that option every time a database connection is made. It would just add overhead and inefficiency. I'm not a MySQL user, though, so I can't say for certain that there isn't another reason.