debian-mirror-gitlab/scripts/schema_changed.sh

16 lines
423 B
Bash
Raw Normal View History

2018-11-20 20:47:30 +05:30
#!/bin/sh
schema_changed() {
if [ ! -z "$(git diff --name-only -- db/schema.rb)" ]; then
printf "db/schema.rb after rake db:migrate:reset is different from one in the repository"
printf "The diff is as follows:\n"
diff=$(git diff -p --binary -- db/schema.rb)
printf "%s" "$diff"
2018-03-17 18:26:18 +05:30
exit 1
else
2018-11-20 20:47:30 +05:30
printf "db/schema.rb after rake db:migrate:reset matches one in the repository"
2018-03-17 18:26:18 +05:30
fi
}
schema_changed