diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-01-02 21:29:10 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-01-02 21:29:10 +0000 |
commit | 92c661f4dade61e67a33482536d473f5ea298b62 (patch) | |
tree | 503cc444406e3ee11ce78e925c25873173dfe5de | |
parent | 45ca565a024913acfee4459ba51b31fdb4e9e531 (diff) | |
download | sonarqube-92c661f4dade61e67a33482536d473f5ea298b62.tar.gz sonarqube-92c661f4dade61e67a33482536d473f5ea298b62.zip |
fix derby migration
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/db/migrate/163_add_variation_columns.rb | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/163_add_variation_columns.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/163_add_variation_columns.rb index 00b079eb6f3..62048e4bfba 100644 --- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/163_add_variation_columns.rb +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/163_add_variation_columns.rb @@ -45,8 +45,13 @@ class AddVariationColumns < ActiveRecord::Migration add_measures_column('variation_value_2') add_measures_column('variation_value_3') add_measures_column('variation_value_4') - add_measures_column('variation_value_5') + add_measures_column('variation_value_5') + + add_snapshots_columns() end + + ProjectMeasure.reset_column_information() + Snapshot.reset_column_information() end private @@ -202,4 +207,34 @@ class AddVariationColumns < ActiveRecord::Migration ProjectMeasure.reset_column_information() end end + + def self.add_snapshots_columns() + Snapshot.reset_column_information() + + add_period_column('period1_mode', :string, :null => true, :limit => 100) + add_period_column('period1_param', :string, :null => true, :limit => 100) + add_period_column('period1_date', :datetime, :null => true) + + add_period_column('period2_mode', :string, :null => true, :limit => 100) + add_period_column('period2_param', :string, :null => true, :limit => 100) + add_period_column('period2_date', :datetime, :null => true) + + add_period_column('period3_mode', :string, :null => true, :limit => 100) + add_period_column('period3_param', :string, :null => true, :limit => 100) + add_period_column('period3_date', :datetime, :null => true) + + add_period_column('period4_mode', :string, :null => true, :limit => 100) + add_period_column('period4_param', :string, :null => true, :limit => 100) + add_period_column('period4_date', :datetime, :null => true) + + add_period_column('period5_mode', :string, :null => true, :limit => 100) + add_period_column('period5_param', :string, :null => true, :limit => 100) + add_period_column('period5_date', :datetime, :null => true) + end + + def self.add_period_column(name, type, options={}) + unless Snapshot.column_names.include?(name) + add_column(:snapshots, name, type, options) + end + end end |