Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#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 Gabriel Hurley, 14 years ago

Triage Stage: UnreviewedAccepted

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.

comment:2 by Ramiro Morales, 14 years ago

Resolution: fixed
Status: newclosed

(In [14558]) Fixed #14536 -- Corrected DB connection OPTIONS examples in documentation. Thanks denilsonsa for reporting the error.

comment:3 by Ramiro Morales, 14 years ago

(In [14559]) Fixed #14536 -- Corrected DB connection OPTIONS examples in documentation. Thanks denilsonsa for reporting the error.

Note: See TracTickets for help on using tickets.
Back to Top