diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-07-26 11:55:44 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-07-26 11:55:44 +0200 |
commit | 2ef985b4603128e17ae4228d54b7d16ae58c007f (patch) | |
tree | faf90f0f508a17f6629c598ec8130ab56149ef55 /sonar-server | |
parent | 60d8f5f0cc60308c5a291f35e39cbccd4e36b888 (diff) | |
download | sonarqube-2ef985b4603128e17ae4228d54b7d16ae58c007f.tar.gz sonarqube-2ef985b4603128e17ae4228d54b7d16ae58c007f.zip |
SONAR-2644 Rule name should be optional in XML declaration files
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/db/migrate/216_set_nullable_rule_name.rb | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/216_set_nullable_rule_name.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/216_set_nullable_rule_name.rb new file mode 100644 index 00000000000..90d558ff388 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/216_set_nullable_rule_name.rb @@ -0,0 +1,37 @@ +# +# Sonar, entreprise quality control tool. +# Copyright (C) 2008-2011 SonarSource +# mailto:contact AT sonarsource DOT com +# +# Sonar 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. +# +# Sonar 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 Sonar; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 +# + +# +# Sonar 2.10 +# +class SetNullableRuleName < ActiveRecord::Migration + + def self.up + add_column(:rules, :temp_name, :string, :limit => 200, :null => true) + Rule.reset_column_information + + Rule.update_all('temp_name=name') + + remove_column(:rules, :name) + rename_column(:rules, :temp_name, :name) + Rule.reset_column_information + end + +end |