Skip to content

Commit

Permalink
only run fake migrations the first time
Browse files Browse the repository at this point in the history
  • Loading branch information
bdzim committed Aug 24, 2017
1 parent 68dd7f8 commit fece125
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions upgrade/upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit fece125

Please sign in to comment.