summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2016-01-19 03:01:14 +0000
committerRobert Speicher <robert@gitlab.com>2016-01-19 03:01:14 +0000
commit2becc6fae9b82479b644c0ca10b758cf8447bc19 (patch)
tree4cad073a1df07d8a9b5fe0e2920961eea1d69a56
parent0782ca771ab4af9fdccb844d752d588bb61f6d9f (diff)
parent96440042a904274b88afc25eddd46c2722482427 (diff)
downloadgitlab-ce-2becc6fae9b82479b644c0ca10b758cf8447bc19.tar.gz
Merge branch 'warning-pending-migrations' into 'master'
Raise an error on page load when there are pending migrations in development mode. Fixes #5990 See merge request !2491
-rw-r--r--.gitlab-ci.yml4
-rw-r--r--config/environments/development.rb3
-rw-r--r--lib/gitlab/current_settings.rb1
3 files changed, 5 insertions, 3 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c23a7a3bf0e..ac8390074f4 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -8,7 +8,7 @@ before_script:
- touch log/application.log
- touch log/test.log
- bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}"
- - bundle exec rake db:reset db:create RAILS_ENV=test
+ - RAILS_ENV=test bundle exec rake db:drop db:create db:schema:load db:migrate
spec:feature:
script:
@@ -118,7 +118,7 @@ flay:
- mysql
bundler:audit:
- script:
+ script:
- "bundle exec bundle-audit update"
- "bundle exec bundle-audit check"
tags:
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 257c163720a..689694a3480 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -16,6 +16,9 @@ Rails.application.configure do
# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log
+ # Raise an error on page load if there are pending migrations
+ config.active_record.migration_error = :page_load
+
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
diff --git a/lib/gitlab/current_settings.rb b/lib/gitlab/current_settings.rb
index 7f938780ab1..ea054255820 100644
--- a/lib/gitlab/current_settings.rb
+++ b/lib/gitlab/current_settings.rb
@@ -39,7 +39,6 @@ module Gitlab
end
use_db && ActiveRecord::Base.connection.active? &&
- !ActiveRecord::Migrator.needs_migration? &&
ActiveRecord::Base.connection.table_exists?('application_settings')
rescue ActiveRecord::NoDatabaseError