aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/webapp
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-07-01 11:19:43 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-07-01 11:19:43 +0200
commit5fbf1cf28418d2914f18ac89923ba0695d4dfcaa (patch)
tree1907acc696d572cbf5f1c9bb3ce2fbda8438a5de /sonar-server/src/main/webapp
parented8b193aabca70842f9210e46464a26144dc9da5 (diff)
downloadsonarqube-5fbf1cf28418d2914f18ac89923ba0695d4dfcaa.tar.gz
sonarqube-5fbf1cf28418d2914f18ac89923ba0695d4dfcaa.zip
SONAR-4514 Add a default severity when creating manual rules
Diffstat (limited to 'sonar-server/src/main/webapp')
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/556_update_manual_rules_without_severity.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/556_update_manual_rules_without_severity.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/556_update_manual_rules_without_severity.rb
new file mode 100644
index 00000000000..39683486400
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/556_update_manual_rules_without_severity.rb
@@ -0,0 +1,34 @@
+#
+# SonarQube, open source software quality management tool.
+# Copyright (C) 2008-2014 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.
+#
+
+#
+# SonarQube 4.4
+# SONAR-4514
+#
+class UpdateManualRulesWithoutSeverity < ActiveRecord::Migration
+
+ class Rule < ActiveRecord::Base
+ end
+
+ def self.up
+ Rule.reset_column_information
+ Rule.update_all({:priority => 2, :updated_at => Time.now}, "priority IS NULL AND plugin_name = 'manual'")
+ end
+end