diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-07-21 16:08:39 +0200 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2014-07-21 16:48:43 +0200 |
commit | 1eb5dbdab56e6948ea96ed11e62a399ae9c7d2c3 (patch) | |
tree | daa13ed079b93d3fb09f914f7f053979e83f973b /server/sonar-web/src/main | |
parent | 4e84e479a73a6b384dae7677afe59bcb9362902b (diff) | |
download | sonarqube-1eb5dbdab56e6948ea96ed11e62a399ae9c7d2c3.tar.gz sonarqube-1eb5dbdab56e6948ea96ed11e62a399ae9c7d2c3.zip |
SONAR-5001 Split migration on rules description format (1 to add column, 1 to fill column)
Diffstat (limited to 'server/sonar-web/src/main')
2 files changed, 35 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/581_add_rules_description_format.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/581_add_rules_description_format.rb index 24d620385c0..87d1867acfc 100644 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/581_add_rules_description_format.rb +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/581_add_rules_description_format.rb @@ -24,15 +24,8 @@ # class AddRulesDescriptionFormat < ActiveRecord::Migration - class Rule < ActiveRecord::Base - end - def self.up add_column :rules, :description_format, :string, :null => true, :limit => 20 - - Rule.reset_column_information - Rule.update_all({:description_format => 'HTML', :updated_at => Time.now}, "plugin_name != 'manual' AND template_id IS NULL") - Rule.update_all({:description_format => 'MARKDOWN', :updated_at => Time.now}, "plugin_name = 'manual' OR template_id IS NOT NULL") end end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/582_update_existing_rules_description_format.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/582_update_existing_rules_description_format.rb new file mode 100644 index 00000000000..4f5fc6be52a --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/582_update_existing_rules_description_format.rb @@ -0,0 +1,35 @@ +# +# 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.5 +# SONAR-5001 +# +class UpdateExistingRulesDescriptionFormat < ActiveRecord::Migration + + class Rule < ActiveRecord::Base + end + + def self.up + Rule.reset_column_information + Rule.update_all({:description_format => 'HTML', :updated_at => Time.now}, "plugin_name != 'manual' AND template_id IS NULL") + Rule.update_all({:description_format => 'MARKDOWN', :updated_at => Time.now}, "plugin_name = 'manual' OR template_id IS NOT NULL") + end +end |