From 38f6fcbf47a7bd4605bd6d4a803ab54dfdec114b Mon Sep 17 00:00:00 2001 From: Eliseu Egewarth Date: Thu, 17 Aug 2017 15:29:22 -0300 Subject: [PATCH] =?UTF-8?q?Adiciona=20rotina=20de=20checagem=20de=20migra?= =?UTF-8?q?=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Eliseu Egewarth --- .travis.yml | 1 + check_migrations.sh | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100755 check_migrations.sh 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