mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-11 05:36:07 +10:00
Fix preventing migration from crashing in very specific cases
See https://gitlab.com/gitlab-org/gitlab-ce/issues/12606 for details
This commit is contained in:
@@ -39,6 +39,13 @@ module Gitlab
|
||||
end
|
||||
|
||||
use_db && ActiveRecord::Base.connection.active? &&
|
||||
# The following condition is important: if a migrations adds a
|
||||
# column to the application_settings table and a validation in
|
||||
# the ApplicationSetting uses this new column we might end-up in
|
||||
# a vicious circle where migration crash before being done.
|
||||
# See https://gitlab.com/gitlab-org/gitlab-ce/issues/12606 for
|
||||
# a thorough explanation.
|
||||
!ActiveRecord::Migrator.needs_migration? &&
|
||||
ActiveRecord::Base.connection.table_exists?('application_settings')
|
||||
|
||||
rescue ActiveRecord::NoDatabaseError
|
||||
|
||||
Reference in New Issue
Block a user