From db548a4e24d2e6086343b9ab4e81e64b03238724 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Sat, 5 Dec 2015 10:26:36 +0530 Subject: [PATCH] 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 --- plinth/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plinth/__main__.py b/plinth/__main__.py index 2ecfaedd7..180b25fab 100644 --- a/plinth/__main__.py +++ b/plinth/__main__.py @@ -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)