Commit 9cd0d68f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add rake task to check db schema is valid

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b7cd5897
......@@ -517,6 +517,12 @@ db:seed_fu-mysql:
<<: *db-seed_fu
<<: *use-mysql
db:check-schema-pg:
<<: *db-migrate-reset
<<: *use-pg
script:
- source scripts/schema_changed.sh
# Frontend-related jobs
gitlab:assets:compile:
<<: *dedicated-runner
......
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
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment