Commit ff0a5936 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch 'schema-changed-ee-backport' into 'master'

Backport schema_changed.sh from EE which prints the diff if the schema is different

See merge request gitlab-org/gitlab-ce!21422
parents 40935fd7 8f51727d
---
title: Backport schema_changed.sh from EE which prints the diff if the schema is different
merge_request: 21422
author: Jasper Maes
type: other
function schema_changed() { #!/bin/sh
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" 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 exit 1
else else
echo "db/schema.rb after rake db:migrate:reset matches one in the repository" printf "db/schema.rb after rake db:migrate:reset matches one in the repository"
fi fi
} }
......
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