From fece125fe35d7b549928e895db145625dfa98282 Mon Sep 17 00:00:00 2001 From: bdzim Date: Thu, 24 Aug 2017 12:31:13 -0500 Subject: [PATCH] only run fake migrations the first time --- upgrade/upgrade.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/upgrade/upgrade.sh b/upgrade/upgrade.sh index 079a1e6..282d1a2 100755 --- a/upgrade/upgrade.sh +++ b/upgrade/upgrade.sh @@ -86,9 +86,11 @@ popd echo "Syncing database" pushd $OPENMANAGE_DJANGO_ROOT/omva -python manage.py migrate --fake openmanage 0001_initial --noinput -python manage.py migrate --fake blue_mgnt 0001_initial --noinput -python manage.py migrate --fake-initial --noinput +if [[ -z $(sudo -u postgres psql openmanage -c "select * from django_migrations where app = 'blue_mgnt' and name = '0001_initial';" -t) ]]; then + python manage.py migrate --fake openmanage 0001_initial --noinput + python manage.py migrate --fake blue_mgnt 0001_initial --noinput + python manage.py migrate --fake-initial --noinput +fi python manage.py migrate --noinput popd