From: Simon Brandhof Date: Wed, 22 Jun 2016 13:43:21 +0000 (+0200) Subject: SONAR-7688 add index to PROJECT_MEASURES.COMPONENT_UUID X-Git-Tag: 6.0-RC1~260 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=57ad62d14359412694fd43b74a363085a79fd68a;p=sonarqube.git SONAR-7688 add index to PROJECT_MEASURES.COMPONENT_UUID --- diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1245_add_index_on_component_uuid_of_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1245_add_index_on_component_uuid_of_measures.rb new file mode 100644 index 00000000000..2dabb9af413 --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1245_add_index_on_component_uuid_of_measures.rb @@ -0,0 +1,29 @@ +# +# 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 6.0 +# +class AddIndexOnComponentUuidOfMeasures < ActiveRecord::Migration + + def self.up + add_index :project_measures, :component_uuid, :name => 'measures_component_uuid' + 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 bf564b92283..c5c58f99d32 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 @@ -30,7 +30,7 @@ import org.sonar.db.MyBatis; public class DatabaseVersion { - public static final int LAST_VERSION = 1_244; + public static final int LAST_VERSION = 1_245; /** * 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 e279cddd5cc..6f8bca251cf 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 @@ -451,6 +451,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1241'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1242'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1243'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1244'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1245'); INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, EXTERNAL_IDENTITY, EXTERNAL_IDENTITY_PROVIDER, USER_LOCAL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT) VALUES (1, 'admin', 'Administrator', '', 'admin', 'sonarqube', true, 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482'); 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 b4148886def..aa11e3b2bab 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 @@ -560,6 +560,8 @@ CREATE INDEX "MEASURES_SID_METRIC" ON "PROJECT_MEASURES" ("SNAPSHOT_ID", "METRIC CREATE INDEX "MEASURES_PERSON" ON "PROJECT_MEASURES" ("PERSON_ID"); +CREATE INDEX "MEASURES_COMPONENT_UUID" ON "PROJECT_MEASURES" ("COMPONENT_UUID"); + CREATE UNIQUE INDEX "METRICS_UNIQUE_NAME" ON "METRICS" ("NAME"); CREATE INDEX "EVENTS_SNAPSHOT_ID" ON "EVENTS" ("SNAPSHOT_ID");