aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-08-08 10:38:46 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-08-08 10:38:46 +0200
commitc4a1b59a43b05259cc063594391e953c8f820368 (patch)
tree38b7405ab3a57757bb33b0cdf2e3cf7de5e94d53
parentf140b7f8ca308188b367449e11cf1ee94f8a2c9b (diff)
downloadsonarqube-c4a1b59a43b05259cc063594391e953c8f820368.tar.gz
sonarqube-c4a1b59a43b05259cc063594391e953c8f820368.zip
SONAR-2673 Fail to upgrade from 2.8 to 2.9 because of migration of reviews
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/201_change_false_positive_on_reviews.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/201_change_false_positive_on_reviews.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/201_change_false_positive_on_reviews.rb
index fa0d157e867..dfaeed23ffa 100644
--- a/sonar-server/src/main/webapp/WEB-INF/db/migrate/201_change_false_positive_on_reviews.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/201_change_false_positive_on_reviews.rb
@@ -27,14 +27,8 @@ class ChangeFalsePositiveOnReviews < ActiveRecord::Migration
add_column 'reviews', 'resolution', :string, :limit => 200, :null => true
Review.reset_column_information
- Review.find(:all).each do |review|
- if review.review_type == 'FALSE_POSITIVE'
- review.status = 'RESOLVED'
- review.resolution = 'FALSE-POSITIVE'
- end
- review.save!
- end
-
+ Review.update_all("status='RESOLVED', resolution='FALSE-POSITIVE'", "review_type='FALSE_POSITIVE'")
+
remove_column 'reviews', 'review_type'
Review.reset_column_information
end