]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5007 fix db migrations 538 and 539
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 23 May 2014 21:35:23 +0000 (23:35 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 23 May 2014 21:35:23 +0000 (23:35 +0200)
sonar-server/src/main/webapp/WEB-INF/db/migrate/538_add_dates_to_active_rules_table.rb
sonar-server/src/main/webapp/WEB-INF/db/migrate/539_insert_active_rule_dates.rb

index bb363507ebb8c7f6e7568ae2c45b671ae0116602..df05fdc7ce920b4597ec3f153f27830af8425f90 100644 (file)
 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
 
index 1945bca7e61c3eb7748a518b98f8338261359473..cbb36a2ecf95831a6fc79822227a1da30e2d690e 100644 (file)
@@ -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