2018-08-30 02:28:15 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
schema_changed() {
|
2020-03-22 11:09:49 -04:00
|
|
|
if [ ! -z "$(git diff --name-only -- db/structure.sql)" ]; then
|
2020-04-29 11:09:58 -04:00
|
|
|
printf "Schema changes are not cleanly committed to db/structure.sql\n"
|
2018-08-30 02:28:15 -04:00
|
|
|
printf "The diff is as follows:\n"
|
2020-03-22 11:09:49 -04:00
|
|
|
diff=$(git diff -p --binary -- db/structure.sql)
|
2018-08-30 02:28:15 -04:00
|
|
|
printf "%s" "$diff"
|
2017-09-19 08:58:25 -04:00
|
|
|
exit 1
|
|
|
|
else
|
2020-04-29 11:09:58 -04:00
|
|
|
printf "Schema changes are correctly applied to db/structure.sql\n"
|
2017-09-19 08:58:25 -04:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
schema_changed
|