summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-05-23 23:35:23 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-05-23 23:35:23 +0200
commit1202d75b442f3424c2c8cb7241dde1c51123f785 (patch)
tree6a542aae8f2941c58dcc7ea85d6f7406943ad49d
parent286759b6507b81dfaffc4b1ba61968021002c129 (diff)
downloadsonarqube-1202d75b442f3424c2c8cb7241dde1c51123f785.tar.gz
sonarqube-1202d75b442f3424c2c8cb7241dde1c51123f785.zip
SONAR-5007 fix db migrations 538 and 539
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/538_add_dates_to_active_rules_table.rb6
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/539_insert_active_rule_dates.rb1
2 files changed, 3 insertions, 4 deletions
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