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