]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5001 Add DB column to store description format
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 9 Jul 2014 16:06:34 +0000 (18:06 +0200)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 16 Jul 2014 13:47:03 +0000 (15:47 +0200)
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/581_add_rules_description_format.rb [new file with mode: 0644]
sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl

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
new file mode 100644 (file)
index 0000000..ea5eec8
--- /dev/null
@@ -0,0 +1,13 @@
+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})
+  end
+
+end
index 4c6d911578e0d76f1421daa3394377304475e303..2ad5a2f48744b510ccd8512b5a2ea2363613aa3a 100644 (file)
@@ -33,7 +33,7 @@ import java.util.List;
  */
 public class DatabaseVersion implements BatchComponent, ServerComponent {
 
-  public static final int LAST_VERSION = 580;
+  public static final int LAST_VERSION = 581;
 
   public static enum Status {
     UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL
index 794585768855af7fec75427306c95afcff337122..555a2914acb822f81fc1e61048853caff72360dd 100644 (file)
@@ -250,6 +250,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('554');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('555');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('556');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('580');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('581');
 
 INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '2011-09-26 22:27:48.0', '2011-09-26 22:27:48.0', null, null);
 ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
index c3a7095f9006087fd6dee9251da4b0e4a4e37207..d3c9a53a3e493755c8b640b3c1dac26a47a97197 100644 (file)
@@ -127,6 +127,7 @@ CREATE TABLE "RULES" (
   "PLUGIN_RULE_KEY" VARCHAR(200) NOT NULL,
   "PLUGIN_NAME" VARCHAR(255) NOT NULL,
   "DESCRIPTION" VARCHAR(16777215),
+  "DESCRIPTION_FORMAT" VARCHAR(20),
   "PRIORITY" INTEGER,
   "IS_TEMPLATE" BOOLEAN DEFAULT FALSE,
   "TEMPLATE_ID" INTEGER,