gitlab-org--gitlab-foss/scripts/schema_changed.sh

16 lines
423 B
Bash
Executable File

#!/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"
exit 1
else
printf "db/schema.rb after rake db:migrate:reset matches one in the repository"
fi
}
schema_changed