From ec84476fae299132a85d2f924bf0643d72caf5e3 Mon Sep 17 00:00:00 2001 From: Lucian Ursu Date: Fri, 22 Feb 2013 15:38:46 +0200 Subject: [PATCH] Using a single task to sync the db and run migrations. --- fabfile.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/fabfile.py b/fabfile.py index 0629fe0..2285466 100755 --- a/fabfile.py +++ b/fabfile.py @@ -53,21 +53,8 @@ def prod(): ########## DATABASE MANAGEMENT @task def syncdb(): - """Run a syncdb.""" - local('%(run)s syncdb --noinput' % env) - - -@task -def migrate(app=None): - """Apply one (or more) migrations. If no app is specified, fabric will - attempt to run a site-wide migration. - - :param str app: Django app name to migrate. - """ - if app: - local('%s migrate %s --noinput' % (env.run, app)) - else: - local('%(run)s migrate --noinput' % env) + """Runs syncdb (along with any pending South migrations)""" + run('python manage.py syncdb --noinput --migrate') ########## END DATABASE MANAGEMENT -- 2.25.1