]> git.openstreetmap.org Git - rails.git/commitdiff
Teach travis to validate the database schema
authorTom Hughes <tom@compton.nu>
Wed, 24 Apr 2019 09:26:50 +0000 (10:26 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 24 Apr 2019 17:29:54 +0000 (18:29 +0100)
.travis.yml

index 8e61677fd26521109858fc43615e79a667ee807c..459c36f4fa2362245eb84734c97559ff6f4af8cf 100644 (file)
@@ -15,6 +15,7 @@ env:
   global:
     - OSM_MEMCACHE_SERVERS="127.0.0.1"
 before_script:
+  - sed -e "/idle_in_transaction_session_timeout/d" -e 's/ IMMUTABLE / /' -e "s/AS '.*libpgosm.*',/AS 'libpgosm',/" -e "/^--/d" db/structure.sql > db/structure.expected
   - psql -U postgres -c "CREATE DATABASE openstreetmap"
   - psql -U postgres -c "CREATE EXTENSION btree_gist" openstreetmap
   - make -C db/functions libpgosm.so
@@ -30,4 +31,7 @@ script:
   - bundle exec rubocop -f fuubar
   - bundle exec rake eslint:run_all
   - bundle exec erblint .
+  - bundle exec rake db:structure:dump
+  - sed -e "/idle_in_transaction_session_timeout/d" -e 's/ IMMUTABLE / /' -e "s/AS '.*libpgosm.*',/AS 'libpgosm',/" -e "/^--/d" db/structure.sql > db/structure.actual
+  - diff -uw db/structure.expected db/structure.actual
   - bundle exec rake test:db