From: Stephane Gamard Date: Fri, 6 Jun 2014 13:35:34 +0000 (+0200) Subject: SONAR-5082 - Added Index to active_rules table X-Git-Tag: 4.4-RC1~578 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=704fd9dfbe8233d7453ab87361f520fd3fe35050;p=sonarqube.git SONAR-5082 - Added Index to active_rules table --- 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 0f053af5e71..0f09ae4b819 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 = 540; + public static final int LAST_VERSION = 541; public static enum Status { UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/541_create_active_rule_index.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/541_create_active_rule_index.rb new file mode 100644 index 00000000000..31cb1d0929e --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/541_create_active_rule_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. +# +class CreateLogTable < ActiveRecord::Migration + + + def self.up + begin + add_index :active_rule, :profile_id, :rule_id => 'act_rul_id' + rescue + # already exists + end + end + +end