In Django, how do I set the default so that every model is created with INNODB?
Right now, Django defaults to MYISAM...but I want to change 开发者_开发技巧it so that everytime I create a new table it is innodb.
Put that in settings.py:
DATABASE_ENGINE = 'mysql'
DATABASE_OPTIONS = {"init_command": "SET storage_engine=INNODB"}
UPDATE
For Django >= 1.2 this should be write like this:
DATABASES = {
'default': {
'ENGINE': 'mysql',
'OPTIONS': {'init_command': 'SET storage_engine=INNODB'}
}
}
精彩评论