]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3825 fix migration of conditions on new_ metrics
authorSimon Brandhof <simon.brandhof@gmail.com>
Tue, 11 Dec 2012 09:19:14 +0000 (10:19 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Tue, 11 Dec 2012 09:19:14 +0000 (10:19 +0100)
sonar-server/src/main/webapp/WEB-INF/db/migrate/360_move_existing_measure_filters.rb

index 9fee2977e5a744cd9409a0a58302bcf96c1e55fc..606494245f2f105dc849c58dd6d292c92c9748e6 100644 (file)
@@ -126,7 +126,7 @@ class MoveExistingMeasureFilters < ActiveRecord::Migration
         data << "c#{metric_criteria_id}_metric=#{old.kee}"
         data << "c#{metric_criteria_id}_op=#{operator_code(old.operator)}"
         data << "c#{metric_criteria_id}_val=#{old.value}"
-        data << "c#{metric_criteria_id}_period=#{old_filter.period_index}" if old.variation && old_filter.period_index
+        data << "c#{metric_criteria_id}_period=#{old_filter.period_index}" if old_filter.period_index && (old.variation || old.kee.start_with?('new_'))
         metric_criteria_id += 1
       elsif old.family=='direct-children' && old.text_value=='true'
         data << "onBaseComponents=true"