From c4a1b59a43b05259cc063594391e953c8f820368 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 8 Aug 2011 10:38:46 +0200 Subject: [PATCH] SONAR-2673 Fail to upgrade from 2.8 to 2.9 because of migration of reviews --- .../db/migrate/201_change_false_positive_on_reviews.rb | 10 ++-------- 1 file 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 -- 2.39.5