aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2015-09-16 16:22:04 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2015-09-17 10:04:55 +0200
commit76b19e2f1e2ce590d0a93a5d42c7e0120bedc7bd (patch)
tree0e40936a36a460a4e14190cae54275da3fb0bd94
parent0911df5cb9337139318115673ebef6dc3925a4c8 (diff)
downloadsonarqube-76b19e2f1e2ce590d0a93a5d42c7e0120bedc7bd.tar.gz
sonarqube-76b19e2f1e2ce590d0a93a5d42c7e0120bedc7bd.zip
SONAR-6845 Add index on PROJECTS.QUALIFIER
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/930_add_projects_qualifier_index.rb31
-rw-r--r--sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java2
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql1
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl2
4 files changed, 35 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/930_add_projects_qualifier_index.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/930_add_projects_qualifier_index.rb
new file mode 100644
index 00000000000..b0a95b0c588
--- /dev/null
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/930_add_projects_qualifier_index.rb
@@ -0,0 +1,31 @@
+#
+# 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 5.2
+# SONAR-6845
+#
+class AddProjectsQualifierIndex < ActiveRecord::Migration
+
+ def self.up
+ add_index 'projects', 'qualifier', :name => 'projects_qualifier'
+ end
+
+end
diff --git a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
index b29b1aec861..f362a4c9693 100644
--- a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
+++ b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
@@ -29,7 +29,7 @@ import org.sonar.db.MyBatis;
public class DatabaseVersion {
- public static final int LAST_VERSION = 929;
+ public static final int LAST_VERSION = 930;
/**
* The minimum supported version which can be upgraded. Lower
diff --git a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
index 85d08cd29f7..9a4170eaf70 100644
--- a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
+++ b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
@@ -348,6 +348,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('926');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('927');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('928');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('929');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('930');
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', '1418215735482', '1418215735482', null, null);
ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
diff --git a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
index 2ea8ececdef..a1a27b835e6 100644
--- a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
+++ b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
@@ -604,6 +604,8 @@ CREATE INDEX "PROJECTS_PROJECT_UUID" ON "PROJECTS" ("PROJECT_UUID");
CREATE INDEX "PROJECTS_MODULE_UUID" ON "PROJECTS" ("MODULE_UUID");
+CREATE INDEX "PROJECTS_QUALIFIER" ON "PROJECTS" ("QUALIFIER");
+
CREATE INDEX "RESOURCE_INDEX_KEE" ON "RESOURCE_INDEX" ("KEE");
CREATE INDEX "RESOURCE_INDEX_RID" ON "RESOURCE_INDEX" ("RESOURCE_ID");