From: Radek Czajka Date: Wed, 23 Apr 2014 14:56:58 +0000 (+0200) Subject: Deploy: add migrate_fake option. X-Git-Tag: 0.1.19~1 X-Git-Url: https://git.mdrn.pl/fnpdjango.git/commitdiff_plain/078af52d6c351b939a7d3c91650c5e43374af500 Deploy: add migrate_fake option. --- diff --git a/fnpdjango/deploy/__init__.py b/fnpdjango/deploy/__init__.py index 1fbe57c..af73eee 100644 --- a/fnpdjango/deploy/__init__.py +++ b/fnpdjango/deploy/__init__.py @@ -16,6 +16,7 @@ Then set up some env properties: localsettings_dst_path (optional): path indicating where to copy the localsettings file, relative to django_root_path (defaults to project_name/localsettings.py) + migrate_fake (optional): list of (app, migration) pairs to fake-migrate skip_collect_static (optional): if True, Django collectstatic command is not called """ from subprocess import check_output @@ -258,6 +259,8 @@ def migrate(): require('app_path', 'project_name') with cd(get_django_root_path('current')): run('%(app_path)s/ve/bin/python manage.py syncdb --noinput' % env, pty=True) + for app, migration in env.get('migrate_fake', ()): + run('%s/ve/bin/python manage.py migrate %s --fake %s' % (env.app_path, app, migration), pty=True) run('%(app_path)s/ve/bin/python manage.py migrate' % env, pty=True) def pre_collectstatic():