From: Julien Lancelot Date: Mon, 19 Jan 2015 15:55:59 +0000 (+0100) Subject: SONAR-6061 Add Index on PROJECTS.MODULE_UUID X-Git-Tag: latest-silver-master-#65~177 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=53247da2a46dfcec2c6af7f378540390b51df200;p=sonarqube.git SONAR-6061 Add Index on PROJECTS.MODULE_UUID --- diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/769_add_projects_module_uuid_index.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/769_add_projects_module_uuid_index.rb new file mode 100644 index 00000000000..5f0d45dd9c3 --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/769_add_projects_module_uuid_index.rb @@ -0,0 +1,33 @@ +# +# 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.1 +# SONAR-6061 + +# +class AddProjectsModuleUuidIndex < ActiveRecord::Migration + + def self.up + add_index 'projects', 'module_uuid', :name => 'projects_module_uuid' + end + +end + diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java index 7e8d536c4d7..c06f0d75330 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java @@ -33,7 +33,7 @@ import java.util.List; */ public class DatabaseVersion implements BatchComponent, ServerComponent { - public static final int LAST_VERSION = 768; + public static final int LAST_VERSION = 769; /** * List of all the tables.n diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql index 39ac9d738fc..f25336b3b50 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql @@ -297,6 +297,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('765'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('766'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('767'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('768'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('769'); 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-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl index 835280c1787..68a4c96b538 100644 --- a/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl +++ b/sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl @@ -636,6 +636,8 @@ CREATE UNIQUE INDEX "PROJECTS_UUID" ON "PROJECTS" ("UUID"); CREATE INDEX "PROJECTS_PROJECT_UUID" ON "PROJECTS" ("PROJECT_UUID"); +CREATE INDEX "PROJECTS_MODULE_UUID" ON "PROJECTS" ("MODULE_UUID"); + CREATE INDEX "RESOURCE_INDEX_KEE" ON "RESOURCE_INDEX" ("KEE"); CREATE INDEX "RESOURCE_INDEX_RID" ON "RESOURCE_INDEX" ("RESOURCE_ID");