gitlab-org--gitlab-foss/scripts/schema_changed.sh
Dmitriy Zaporozhets 9cd0d68fe9
Add rake task to check db schema is valid
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2017-09-19 16:42:44 +03:00

10 lines
304 B
Bash

function schema_changed() {
if [[ ! -z `git diff --name-only -- db/schema.rb` ]]; then
echo "db/schema.rb after rake db:migrate:reset is different from one in the repository"
exit 1
else
echo "db/schema.rb after rake db:migrate:reset matches one in the repository"
fi
}
schema_changed