aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp/WEB-INF
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-server/src/main/webapp/WEB-INF')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb2
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb10
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/161_add_snapshots_variation_columns.rb43
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/162_delete_iso_rule_categories.rb1
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/163_add_measure_variation_values.rb (renamed from sonar-server/src/main/webapp/WEB-INF/db/migrate/161_add_snapshots_var_columns.rb)14
6 files changed, 59 insertions, 15 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb
index 80da25d2f0c..a0d49e16773 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/controllers/api/resources_controller.rb
@@ -201,7 +201,7 @@ class Api::ResourcesController < Api::ApiController
def select_columns_for_measures
select_columns='project_measures.id,project_measures.value,project_measures.metric_id,project_measures.snapshot_id,project_measures.rule_id,project_measures.rule_priority,project_measures.text_value,project_measures.characteristic_id'
if params[:includetrends]=='true'
- select_columns+=',project_measures.tendency,project_measures.diff_value_1,project_measures.diff_value_2,project_measures.diff_value_3'
+ select_columns+=',project_measures.tendency,project_measures.variation_value_1,project_measures.variation_value_2,project_measures.variation_value_3,project_measures.variation_value_4,project_measures.variation_value_5'
end
if params[:includealerts]=='true'
select_columns+=',project_measures.alert_status,project_measures.alert_text'
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb b/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb
index c72240dcfc2..d5e095c22ba 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/helpers/dashboard_helper.rb
@@ -30,8 +30,8 @@ module DashboardHelper
def variation_select_option(snapshot, index)
return nil if snapshot.nil? || snapshot.project_snapshot.nil?
- mode=snapshot.project_snapshot.send "var_mode_#{index}"
- mode_param=snapshot.project_snapshot.send "var_label_#{index}"
+ mode=snapshot.project_snapshot.send "variation_mode_#{index}"
+ mode_param=snapshot.project_snapshot.send "variation_param_#{index}"
if mode
if mode=='days'
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb
index 8e08ab98147..13768dcbeba 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/project_measure.rb
@@ -111,11 +111,15 @@ class ProjectMeasure < ActiveRecord::Base
result = nil
case variation_index
when 1
- result=diff_value_1
+ result=variation_value_1
when 2
- result=diff_value_2
+ result=variation_value_2
when 3
- result=diff_value_3
+ result=variation_value_3
+ when 4
+ result=variation_value_4
+ when 5
+ result=variation_value_5
end
result
end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/161_add_snapshots_variation_columns.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/161_add_snapshots_variation_columns.rb
new file mode 100644
index 00000000000..fa4760c9c69
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/161_add_snapshots_variation_columns.rb
@@ -0,0 +1,43 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2009 SonarSource SA
+# mailto:contact AT sonarsource DOT com
+#
+# Sonar is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 3 of the License, or (at your option) any later version.
+#
+# Sonar is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with Sonar; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+#
+
+#
+# Sonar 2.5
+#
+class AddSnapshotsVariationColumns < ActiveRecord::Migration
+
+ def self.up
+ add_column :snapshots, :variation_mode_1, :string, :null => true, :limit => 100
+ add_column :snapshots, :variation_param_1, :string, :null => true, :limit => 100
+
+ add_column :snapshots, :variation_mode_2, :string, :null => true, :limit => 100
+ add_column :snapshots, :variation_param_2, :string, :null => true, :limit => 100
+
+ add_column :snapshots, :variation_mode_3, :string, :null => true, :limit => 100
+ add_column :snapshots, :variation_param_3, :string, :null => true, :limit => 100
+
+ add_column :snapshots, :variation_mode_4, :string, :null => true, :limit => 100
+ add_column :snapshots, :variation_param_4, :string, :null => true, :limit => 100
+
+ add_column :snapshots, :variation_mode_5, :string, :null => true, :limit => 100
+ add_column :snapshots, :variation_param_5, :string, :null => true, :limit => 100
+ end
+
+end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/162_delete_iso_rule_categories.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/162_delete_iso_rule_categories.rb
index 413b26a437d..f4253c74b59 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/162_delete_iso_rule_categories.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/162_delete_iso_rule_categories.rb
@@ -23,7 +23,6 @@
#
class DeleteIsoRuleCategories < ActiveRecord::Migration
-
def self.up
remove_rule_categories
delete_measures_on_iso_category
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/161_add_snapshots_var_columns.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/163_add_measure_variation_values.rb
index 7c18dd8ad0f..1edc362fe87 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/161_add_snapshots_var_columns.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/163_add_measure_variation_values.rb
@@ -21,16 +21,14 @@
#
# Sonar 2.5
#
-class AddSnapshotsVarColumns < ActiveRecord::Migration
+class AddMeasureVariationValues < ActiveRecord::Migration
def self.up
- add_column :snapshots, :var_mode_1, :string, :null => true, :limit => 100
- add_column :snapshots, :var_mode_2, :string, :null => true, :limit => 100
- add_column :snapshots, :var_mode_3, :string, :null => true, :limit => 100
-
- add_column :snapshots, :var_label_1, :string, :null => true, :limit => 100
- add_column :snapshots, :var_label_2, :string, :null => true, :limit => 100
- add_column :snapshots, :var_label_3, :string, :null => true, :limit => 100
+ rename_column :project_measures, :diff_value_1, :variation_value_1
+ rename_column :project_measures, :diff_value_2, :variation_value_2
+ rename_column :project_measures, :diff_value_3, :variation_value_3
+ add_column(:project_measures, :variation_value_4, :decimal, :null => true, :precision => 30, :scale => 20)
+ add_column(:project_measures, :variation_value_5, :decimal, :null => true, :precision => 30, :scale => 20)
end
end