]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5755 Move creation of projects.uuid index after uuid columns have been populated
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 28 Oct 2014 15:23:08 +0000 (16:23 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Tue, 28 Oct 2014 15:45:56 +0000 (16:45 +0100)
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/704_add_project_uuid_columns.rb
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/708_add_project_uuid_index.rb [new file with mode: 0644]
sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql

index fd07ca0a1c861d26217e6d067ce6f4683d19b0b9..82ca52700637187ba223c48ac0e76379fe8b183a 100644 (file)
@@ -28,8 +28,6 @@ class AddProjectUuidColumns < ActiveRecord::Migration
     add_column 'projects', :project_uuid, :string, :limit => 50, :null => true
     add_column 'projects', :module_uuid, :string, :limit => 50, :null => true
     add_column 'projects', :module_uuid_path, :string, :limit => 4000, :null => true
-
-    add_index 'projects', 'uuid', :name => 'projects_uuid', :unique => true
   end
 end
 
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/708_add_project_uuid_index.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/708_add_project_uuid_index.rb
new file mode 100644 (file)
index 0000000..5d81bd0
--- /dev/null
@@ -0,0 +1,30 @@
+#
+# 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.0
+# SONAR-5753
+#
+class AddProjectUuidIndex < ActiveRecord::Migration
+  def self.up
+    add_index 'projects', 'uuid', :name => 'projects_uuid', :unique => true
+  end
+end
+
index 8bba43268993c6b20d243ef8070a2caf1961febd..67d12f924f68d04f15cc949291c27448f913c75f 100644 (file)
@@ -33,7 +33,7 @@ import java.util.List;
  */
 public class DatabaseVersion implements BatchComponent, ServerComponent {
 
-  public static final int LAST_VERSION = 707;
+  public static final int LAST_VERSION = 708;
   /**
    * List of all the tables.
    * This list is hardcoded because we didn't succeed in using java.sql.DatabaseMetaData#getTables() in the same way
index e06d8bbef12081dba2a71b4083933b8ff8a4f125..53ae285d061592d0747d3cc493d116694be8ac01 100644 (file)
@@ -267,6 +267,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('704');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('705');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('706');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('707');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('708');
 
 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', '2011-09-26 22:27:48.0', '2011-09-26 22:27:48.0', null, null);
 ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;