diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-12-03 15:35:14 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2014-12-03 15:35:19 +0100 |
commit | 347713f585f2dcec1b2ee4a4e6df62c222eee6cb (patch) | |
tree | c6852e7c36183083f0eaf701557ff76cdb85f284 | |
parent | b35786ca98090b62497a08a02e8b486892da7eac (diff) | |
download | sonarqube-347713f585f2dcec1b2ee4a4e6df62c222eee6cb.tar.gz sonarqube-347713f585f2dcec1b2ee4a4e6df62c222eee6cb.zip |
Fix db migration on mssql
-rw-r--r-- | server/sonar-web/src/main/webapp/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb index 201fee6405e..6291d8d422b 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb @@ -490,9 +490,12 @@ module ActiveRecord ddl_transaction do migration.migrate(@direction) - #SONAR fix closed connections (mainly MySQL) when Java migration is long to be executed. - # Database can close the underlying connection if no activity for a while. - Base.connection.reconnect! + #SONAR + # Fix closed connections when Java migration is long to be executed. + # MySQL can close the underlying connection if no activity for a while. + if Base.configurations[ENV['RAILS_ENV']]['dialect']=='mysql' + Base.connection.reconnect! + end #/SONAR record_version_state_after_migrating(migration.version) |