Create a new yugatic migration (just an empty migration):
python manage.py datamigration <app> create_cache_table
Edit the generated migration. I just named the cache table cache.
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
from django.core.management import call_command
class Migration(DataMigration):
def forwards(self, orm):
call_command('createcachetable', 'cache')
def backwards(self, orm):
db.delete_table('cache')
...
, . import dbs db. : https://docs.djangoproject.com/en/dev/topics/cache/#multiple-databases.
import datetime
from south.db import dbs
from south.v2 import DataMigration
from django.db import models
from django.core.management import call_command
class Migration(DataMigration):
def forwards(self, orm):
call_command('createcachetable', 'cache', database='other_database')
def backwards(self, orm):
dbs['other_database'].delete_table('cache')
...