开发者

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'}
                        }
            }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜