Detta kan hjälpa:
from django.core.management.base import BaseCommand
from django.db import connections
class Command(BaseCommand):
def handle(self, database="default", *args, **options):
cursor = connections[database].cursor()
cursor.execute("SHOW TABLE STATUS")
for row in cursor.fetchall():
if row[1] != "InnoDB":
print "Converting %s" % row[0],
print cursor.execute("ALTER TABLE %s ENGINE=INNODB" % row[0])
Lägg till det i din app under mappar management/commands/ Sedan kan du konvertera alla dina tabeller med ett manage.py-kommando:
python manage.py convert_to_innodb