diff --git a/.travis.yml b/.travis.yml index 0e0a27ad4..5c01b89e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,6 +16,7 @@ before_script: - psql -c "CREATE DATABASE sapl OWNER sapl;" -U postgres script: + - ./check_migrations.sh - ./manage.py migrate - ./manage.py bower install - py.test --create-db diff --git a/check_migrations.sh b/check_migrations.sh new file mode 100755 index 000000000..2355c512a --- /dev/null +++ b/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 \ No newline at end of file