diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-26 16:28:47 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-26 16:28:47 +0200 |
commit | 8038f81f971724510b78daae3f57f9e5fd7d5495 (patch) | |
tree | 270f47132c9b44c7c91d040833d2779c75be466f /sonar-server/src | |
parent | 26fef20a434f89c1029e395eec7b7ada594bd135 (diff) | |
download | sonarqube-8038f81f971724510b78daae3f57f9e5fd7d5495.tar.gz sonarqube-8038f81f971724510b78daae3f57f9e5fd7d5495.zip |
SONAR-4297 SONAR-4295 SONAR-4294 remove some review widgets
Diffstat (limited to 'sonar-server/src')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/db/migrate/402_delete_review_widgets.rb | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/402_delete_review_widgets.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/402_delete_review_widgets.rb new file mode 100644 index 00000000000..0a71d1ccdd8 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/402_delete_review_widgets.rb @@ -0,0 +1,44 @@ +# +# Sonar, entreprise quality control tool. +# Copyright (C) 2008-2013 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. +# + +# +# Sonar 3.6 +# +class DeleteReviewWidgets < ActiveRecord::Migration + + class WidgetProperty < ActiveRecord::Base + end + + class Widget < ActiveRecord::Base + end + + def self.up + delete_widget 'reviews_metrics' + delete_widget 'planned_reviews' + delete_widget 'unplanned_reviews' + end + + def self.delete_widget(widget_key) + Widget.find(:all, :conditions => {:widget_key => widget_key}).each do |widget| + WidgetProperty.delete_all(:widget_id => widget.id) + Widget.delete(widget.id) + end + end +end
\ No newline at end of file |