diff options
author | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-06-04 11:40:21 +0200 |
---|---|---|
committer | Teryk Bellahsene <teryk.bellahsene@sonarsource.com> | 2015-06-04 15:09:51 +0200 |
commit | 406435360f01dab8729475a5d57731f10efaaefd (patch) | |
tree | cbd115e7a58d4dd9b16841c9442e61d0b0d6c2b2 /server/sonar-web/src/main/webapp | |
parent | 594fe9c99ad6cdbdefcfcc7d42d02afffce826a2 (diff) | |
download | sonarqube-406435360f01dab8729475a5d57731f10efaaefd.tar.gz sonarqube-406435360f01dab8729475a5d57731f10efaaefd.zip |
SONAR-6606 drop origin column from metrics table
Diffstat (limited to 'server/sonar-web/src/main/webapp')
3 files changed, 31 insertions, 17 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb index d227701f6d0..0cd475f4485 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/metrics_controller.rb @@ -70,15 +70,7 @@ class MetricsController < ApplicationController else metric = Metric.first(:conditions => ["name = ?", metric_name]) if metric - if metric.origin != Metric::ORIGIN_GUI - @errors << "A standard metric named '#{metric_name}' already exists. Please change the name of the manual metric you want to create." - @metric = Metric.new - @domains = metric.domain - render :partial => 'metrics/create_form', :status => 400 - return - else @reactivate_metric = metric - end else metric = Metric.new end @@ -94,7 +86,6 @@ class MetricsController < ApplicationController metric.direction = 0 metric.user_managed = true metric.qualitative = false - metric.origin = Metric::ORIGIN_GUI metric.enabled = true unless @reactivate_metric begin diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/models/metric.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/models/metric.rb index e437a2bd370..204c8f49b83 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/app/models/metric.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/app/models/metric.rb @@ -37,10 +37,6 @@ class Metric < ActiveRecord::Base TYPE_LEVEL_WARN = 'WARN' TYPE_LEVEL_ERROR = 'ERROR' - ORIGIN_GUI='GUI' - ORIGIN_JAVA='JAV' - ORIGIN_WS='WS' - CACHE_KEY='metrics' I18N_DOMAIN_CACHE_KEY='i18n_domains' I18N_SHORT_NAME_CACHE_KEY='i18n_metric_short_names' @@ -300,10 +296,6 @@ class Metric < ActiveRecord::Base end end - def created_online? - origin==ORIGIN_GUI - end - HUMANIZED_ATTRIBUTES = { :name => "key", :short_name => "name", diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/917_remove_metrics_origin.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/917_remove_metrics_origin.rb new file mode 100644 index 00000000000..d08cb7347ec --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/917_remove_metrics_origin.rb @@ -0,0 +1,31 @@ +# +# SonarQube, open source software quality management tool. +# Copyright (C) 2008-2014 SonarSource +# mailto:contact AT sonarsource DOT com +# +# SonarQube 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. +# +# SonarQube 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 this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# + +# +# SonarQube 5.2 +# SONAR-6606 +# +class RemoveMetricsOrigin < ActiveRecord::Migration + + def self.up + remove_column 'metrics', 'origin' + end + +end |