From: Simon Brandhof Date: Mon, 8 Aug 2011 08:38:46 +0000 (+0200) Subject: SONAR-2673 Fail to upgrade from 2.8 to 2.9 because of migration of reviews X-Git-Tag: 2.10~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c4a1b59a43b05259cc063594391e953c8f820368;p=sonarqube.git SONAR-2673 Fail to upgrade from 2.8 to 2.9 because of migration of reviews --- 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