23π
β
To be sure that all migrations are always done using INNODB, you should set the storage engine as INNODB in the database definition directly, like thisΒ :
DATABASES = {
'default': {
...
'OPTIONS' : { 'init_command' : 'SET storage_engine=INNODB', },
}
If you are using MySQL 5.7.x and above,
DATABASES = {
'default': {
...
'OPTIONS' : { 'init_command' : 'SET default_storage_engine=INNODB', },
}
But you should know that it can have a performance hit. So you may want to set this option only when running migrations.
π€Xixi
14π
If you use South, you can set the STORAGE_ENGINE.
django < 1.2
# add to your settings file
DATABASE_STORAGE_ENGINE = 'INNODB' # django < 1.2
django >= 1.2
# add to your settings file
DATABASES = {
'default': {
...
'STORAGE_ENGINE': 'INNODB'
}
}
π€dnozay
- [Django]-Django middleware difference between process_request and process_view
- [Django]-Cannot access django app through ip address while accessing it through localhost
- [Django]-How do I install psycopg2 for Python 3.x?
Source:stackexchange.com