Commit 2becc6fa authored by Robert Speicher's avatar Robert Speicher

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
parents 0782ca77 96440042
...@@ -8,7 +8,7 @@ before_script: ...@@ -8,7 +8,7 @@ before_script:
- touch log/application.log - touch log/application.log
- touch log/test.log - touch log/test.log
- bundle install --without postgres production --jobs $(nproc) "${FLAGS[@]}" - 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: spec:feature:
script: script:
...@@ -118,7 +118,7 @@ flay: ...@@ -118,7 +118,7 @@ flay:
- mysql - mysql
bundler:audit: bundler:audit:
script: script:
- "bundle exec bundle-audit update" - "bundle exec bundle-audit update"
- "bundle exec bundle-audit check" - "bundle exec bundle-audit check"
tags: tags:
......
...@@ -16,6 +16,9 @@ Rails.application.configure do ...@@ -16,6 +16,9 @@ Rails.application.configure do
# Print deprecation notices to the Rails logger # Print deprecation notices to the Rails logger
config.active_support.deprecation = :log 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 # Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin config.action_dispatch.best_standards_support = :builtin
......
...@@ -39,7 +39,6 @@ module Gitlab ...@@ -39,7 +39,6 @@ module Gitlab
end end
use_db && ActiveRecord::Base.connection.active? && use_db && ActiveRecord::Base.connection.active? &&
!ActiveRecord::Migrator.needs_migration? &&
ActiveRecord::Base.connection.table_exists?('application_settings') ActiveRecord::Base.connection.table_exists?('application_settings')
rescue ActiveRecord::NoDatabaseError rescue ActiveRecord::NoDatabaseError
......
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