Make migration work for older version upgrades

With the --fake-initial argument to migrate, Django will detect the
existance of initial table with the precondition that the table schema
must be the same as the first migration (it is in this case).

https://docs.djangoproject.com/en/1.8/topics/migrations/#adding-migrations-to-apps
This commit is contained in:
Sunil Mohan Adapa 2015-12-05 10:26:36 +05:30 committed by James Valleroy
parent e6117fbcdf
commit db548a4e24

View File

@ -273,7 +273,8 @@ def configure_django():
logger.info('Configured Django with applications - %s', applications)
logger.info('Creating or adding new tables to data file')
django.core.management.call_command('migrate', interactive=False)
django.core.management.call_command('migrate', '--fake-initial',
interactive=False)
os.chmod(cfg.store_file, stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP)