summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/165_set_nullable_rule_config_key.rb37
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/db/migrate/166_set_nullable_rule_parameter_description.rb37
4 files changed, 77 insertions, 3 deletions
diff --git a/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java b/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
index 8051214b04e..824d83f6663 100644
--- a/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
+++ b/sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
@@ -30,7 +30,7 @@ import java.sql.Statement;
public class SchemaMigration {
public final static int VERSION_UNKNOWN = -1;
- public static final int LAST_VERSION = 164;
+ public static final int LAST_VERSION = 166;
public final static String TABLE_NAME = "schema_migrations";
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
index f68f570e2be..d257ef39a2f 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
@@ -48,13 +48,13 @@ public final class Rule {
@Column(name = "name", updatable = true, nullable = false)
private String name;
- @Column(name = "plugin_rule_key", updatable = false, nullable = true)
+ @Column(name = "plugin_rule_key", updatable = false, nullable = true, length = 200)
private String key;
@Column(name = "enabled", updatable = true, nullable = true)
private Boolean enabled = Boolean.TRUE;
- @Column(name = "plugin_config_key", updatable = true, nullable = true)
+ @Column(name = "plugin_config_key", updatable = true, nullable = true, length = 500)
private String configKey;
// Godin: This field should be named priority, otherwise StandardRulesXmlParserTest fails
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/165_set_nullable_rule_config_key.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/165_set_nullable_rule_config_key.rb
new file mode 100644
index 00000000000..b6667c5fe9b
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/165_set_nullable_rule_config_key.rb
@@ -0,0 +1,37 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2009 SonarSource SA
+# 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.5
+#
+class SetNullableRuleConfigKey < ActiveRecord::Migration
+
+ def self.up
+ add_column(:rules, :temp_plugin_config_key, :string, :limit => 500, :null => true)
+ Rule.reset_column_information
+
+ Rule.update_all('temp_plugin_config_key=plugin_config_key')
+
+ remove_column(:rules, :plugin_config_key)
+ rename_column(:rules, :temp_plugin_config_key, :plugin_config_key)
+ Rule.reset_column_information
+ end
+
+end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/166_set_nullable_rule_parameter_description.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/166_set_nullable_rule_parameter_description.rb
new file mode 100644
index 00000000000..874c8101969
--- /dev/null
+++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/166_set_nullable_rule_parameter_description.rb
@@ -0,0 +1,37 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2009 SonarSource SA
+# 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.5
+#
+class SetNullableRuleParameterDescription < ActiveRecord::Migration
+
+ def self.up
+ add_column(:rules_parameters, :temp_description, :string, :limit => 4000, :null => true)
+ RulesParameter.reset_column_information
+
+ RulesParameter.update_all('temp_description=description')
+
+ remove_column(:rules_parameters, :description)
+ rename_column(:rules_parameters, :temp_description, :description)
+ RulesParameter.reset_column_information
+ end
+
+end