Browse Source

Adiciona rotina de checagem de migração

Signed-off-by: Eliseu Egewarth <eliseuegewarth@gmail.com>
pull/1411/head
Eliseu Egewarth 7 years ago
parent
commit
38f6fcbf47
  1. 1
      .travis.yml
  2. 8
      check_migrations.sh

1
.travis.yml

@ -16,6 +16,7 @@ before_script:
- psql -c "CREATE DATABASE sapl OWNER sapl;" -U postgres - psql -c "CREATE DATABASE sapl OWNER sapl;" -U postgres
script: script:
- ./check_migrations.sh
- ./manage.py migrate - ./manage.py migrate
- ./manage.py bower install - ./manage.py bower install
- py.test --create-db - py.test --create-db

8
check_migrations.sh

@ -0,0 +1,8 @@
#!/bin/bash
python manage.py makemigrations --dry-run --exit > /dev/null
MIGRATIONS=$?
[ $MIGRATIONS -eq 0 ] && echo "You have unapplied code change. run 'python manage.py makemigrations'" && exit 1
[ $MIGRATIONS -ne 0 ] && echo "" && exit 0
Loading…
Cancel
Save