weblate/ci/run-migrate
Michal Čihař 3285e558e7 Test migrations from 3.1.1
Signed-off-by: Michal Čihař <michal@cihar.com>
2018-08-12 08:07:34 +02:00

33 lines
745 B
Bash
Executable file
Vendored

#!/bin/sh
# Migrations test executor
. ci/lib
TAGS="weblate-3.0.1 weblate-3.1.1"
DBS="sqlite mysql postgresql"
for CI_DATABASE in $DBS ; do
export CI_DATABASE
for tag in $TAGS ; do
rm weblate.db
git checkout $tag || continue
run_coverage ./manage.py migrate
check
git checkout $TRAVIS_COMMIT
run_coverage ./manage.py migrate
check
done
done
./manage.py makemigrations
check
if [ `git status -s | grep -c /migrations/` -gt 0 ] ; then
echo 'There are untracked migrations:'
git status -s --porcelain | grep /migrations/ | sed -n '/^??/ s/^?? \(.*\)/\1/p' | while read migration ; do
echo $migration
cat $migration
echo
done
exit 1
fi