]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2425 Add index on CHARACTERISTIC_PROPERTIES.CHARACTERISTIC_ID
authorEvgeny Mandrikov <mandrikov@gmail.com>
Mon, 23 May 2011 20:15:48 +0000 (00:15 +0400)
committerEvgeny Mandrikov <mandrikov@gmail.com>
Mon, 23 May 2011 22:05:25 +0000 (02:05 +0400)
sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
sonar-server/src/main/webapp/WEB-INF/db/migrate/200_add_index_to_characteristic_property.rb [new file with mode: 0644]
sonar-server/src/main/webapp/WEB-INF/db/migrate/README.txt [new file with mode: 0644]
sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl

index 1a5f54892d7783c25817a667cb6a0218b47dea03..c5d25eb586ff94d902d918c6e4f9e1cfce6edd5c 100644 (file)
@@ -40,7 +40,7 @@ public class SchemaMigration {
       - complete the Derby DDL file used for unit tests : sonar-testing-harness/src/main/resources/org/sonar/test/persistence/sonar-test.ddl
 
    */
-  public static final int LAST_VERSION = 191;
+  public static final int LAST_VERSION = 200;
 
   public final static String TABLE_NAME = "schema_migrations";
 
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/200_add_index_to_characteristic_property.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/200_add_index_to_characteristic_property.rb
new file mode 100644 (file)
index 0000000..87e31a1
--- /dev/null
@@ -0,0 +1,30 @@
+#
+# 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.9
+#
+class AddIndexToCharacteristicProperty < ActiveRecord::Migration
+
+  def self.up
+    add_index :characteristic_properties, :characteristic_id, :name => 'characteristic_properties_characteristic_id'
+  end
+
+end
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/README.txt b/sonar-server/src/main/webapp/WEB-INF/db/migrate/README.txt
new file mode 100644 (file)
index 0000000..15688e3
--- /dev/null
@@ -0,0 +1 @@
+After adding migration script - don't forget to update sonar-core/src/main/java/org/sonar/jpa/entity/SchemaMigration.java
index 54f49a0953becba0732573585abe691ea8a5a565..343aa3f93358567f1daa211c77dcf67ab8776e0d 100644 (file)
@@ -83,6 +83,7 @@ create table CHARACTERISTIC_PROPERTIES (
   TEXT_VALUE VARCHAR(4000),
   primary key (id)
 );
+CREATE INDEX CHARACTERISTIC_PROPERTIES_CHARACTERISTIC_ID ON CHARACTERISTIC_PROPERTIES (CHARACTERISTIC_ID);
 
 create table CRITERIA (
   ID INTEGER not null,
@@ -482,28 +483,28 @@ create table WIDGET_PROPERTIES (
 CREATE INDEX WIDGET_PROPERTIES_WIDGETS ON WIDGET_PROPERTIES (WIDGET_ID);
 
 CREATE TABLE REVIEWS (
-       ID INTEGER NOT NULL,
-       CREATED_AT TIMESTAMP,
-       UPDATED_AT TIMESTAMP,
-       USER_ID INTEGER,
-       ASSIGNEE_ID INTEGER,
-       TITLE VARCHAR(500),
-       REVIEW_TYPE VARCHAR(10),
-       STATUS VARCHAR(10),
-       SEVERITY VARCHAR(10),
-       RULE_FAILURE_PERMANENT_ID INTEGER,
-       PROJECT_ID INTEGER,
-       RESOURCE_ID INTEGER,
-       RESOURCE_LINE INTEGER,
-    primary key (id)
+  ID INTEGER NOT NULL,
+  CREATED_AT TIMESTAMP,
+  UPDATED_AT TIMESTAMP,
+  USER_ID INTEGER,
+  ASSIGNEE_ID INTEGER,
+  TITLE VARCHAR(500),
+  REVIEW_TYPE VARCHAR(10),
+  STATUS VARCHAR(10),
+  SEVERITY VARCHAR(10),
+  RULE_FAILURE_PERMANENT_ID INTEGER,
+  PROJECT_ID INTEGER,
+  RESOURCE_ID INTEGER,
+  RESOURCE_LINE INTEGER,
+  primary key (id)
 );
 
 CREATE TABLE REVIEW_COMMENTS (
-       ID INTEGER NOT NULL,
-       CREATED_AT TIMESTAMP,
-       UPDATED_AT TIMESTAMP,
-       REVIEW_ID INTEGER,
-       USER_ID INTEGER,
-       REVIEW_TEXT CLOB(2147483647),
-    primary key (id)
+  ID INTEGER NOT NULL,
+  CREATED_AT TIMESTAMP,
+  UPDATED_AT TIMESTAMP,
+  REVIEW_ID INTEGER,
+  USER_ID INTEGER,
+  REVIEW_TEXT CLOB(2147483647),
+  primary key (id)
 );