summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-09-19 15:58:25 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-09-19 16:42:44 +0300
commit9cd0d68fe90f27ad297317cd8cc5e8f81c2d75a9 (patch)
tree7ec3a9115dffc8dc1e5051537b0a1b87d33b1fdf /scripts
parentb7cd5897098ec99b5eca7a3ebcc1c70d7501cd23 (diff)
downloadgitlab-ce-9cd0d68fe90f27ad297317cd8cc5e8f81c2d75a9.tar.gz
Add rake task to check db schema is validdz-check-schema
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/schema_changed.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/schema_changed.sh b/scripts/schema_changed.sh
new file mode 100644
index 00000000000..5de2b35571d
--- /dev/null
+++ b/scripts/schema_changed.sh
@@ -0,0 +1,10 @@
+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