mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
travis: Test whether migrations are consistent with models.
This should automatically catch mistakes where someone updates the database models but forgets to generate migrations afterwards.
This commit is contained in:
@@ -16,6 +16,7 @@ function run {
|
||||
|
||||
run ./tools/clean-repo
|
||||
run ./tools/lint-all
|
||||
run ./tools/test-migrations
|
||||
run ./tools/test-js-with-node
|
||||
run ./tools/test-backend
|
||||
run ./tools/test-js-with-casper
|
||||
|
10
tools/test-migrations
Executable file
10
tools/test-migrations
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
echo 'Testing whether migrations are consistent with models'
|
||||
if ./manage.py makemigrations -e --dry-run; then
|
||||
echo
|
||||
echo 'ERROR: Migrations are not consistent with models! Fix with `./manage.py makemigrations`.'
|
||||
echo
|
||||
else
|
||||
echo "Success! Migrations are consistent with models."
|
||||
fi
|
@@ -6,3 +6,4 @@ export PATH=$PATH:/srv/zulip-venv/bin
|
||||
./tools/lint-all
|
||||
./tools/test-backend
|
||||
./tools/test-management
|
||||
./tools/test-migrations
|
||||
|
Reference in New Issue
Block a user