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

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
...@@ -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:
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
# 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 @@ def connect_to_db? ...@@ -39,7 +39,6 @@ def connect_to_db?
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