From: Simon Brandhof Date: Fri, 23 May 2014 21:35:23 +0000 (+0200) Subject: SONAR-5007 fix db migrations 538 and 539 X-Git-Tag: 4.4-RC1~839 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1202d75b442f3424c2c8cb7241dde1c51123f785;p=sonarqube.git SONAR-5007 fix db migrations 538 and 539 --- diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/538_add_dates_to_active_rules_table.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/538_add_dates_to_active_rules_table.rb index bb363507ebb..df05fdc7ce9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/538_add_dates_to_active_rules_table.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/538_add_dates_to_active_rules_table.rb @@ -24,10 +24,8 @@ class AddDatesToActiveRulesTable < ActiveRecord::Migration def self.up - def self.up - add_column 'active_rules', :created_at, :datetime, :null => true - add_column 'active_rules', :updated_at, :datetime, :null => true - end + add_column 'active_rules', :created_at, :datetime, :null => true + add_column 'active_rules', :updated_at, :datetime, :null => true end end diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/539_insert_active_rule_dates.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/539_insert_active_rule_dates.rb index 1945bca7e61..cbb36a2ecf9 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/539_insert_active_rule_dates.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/539_insert_active_rule_dates.rb @@ -27,6 +27,7 @@ class InsertActiveRuleDates < ActiveRecord::Migration end def self.up + ActiveRule.reset_column_information now = Time.now ActiveRule.find(:all).each do |active_rule| active_rule.created_at=now