]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4926 Primary key of the table ISSUES is too short
authorSimon Brandhof <simon.brandhof@gmail.com>
Thu, 28 Nov 2013 20:29:08 +0000 (21:29 +0100)
committerSimon Brandhof <simon.brandhof@gmail.com>
Thu, 28 Nov 2013 21:13:06 +0000 (22:13 +0100)
sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
sonar-server/src/main/webapp/WEB-INF/db/migrate/463_move_issues_id_to_bigint.rb [new file with mode: 0644]

index 7af4c474942a6a978c0487ee1d6c5586bdb8a121..6ddf2dbc146549e9bbf450d34b62314a9995b9d5 100644 (file)
@@ -33,7 +33,7 @@ import java.util.List;
  */
 public class DatabaseVersion implements BatchComponent, ServerComponent {
 
-  public static final int LAST_VERSION = 462;
+  public static final int LAST_VERSION = 463;
 
   public static enum Status {
     UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL
index 4eff6867b7567e890199215f5f0680f2d79b7447..1abb68dedc589d83fe88722be82b90a480d30fa2 100644 (file)
@@ -476,7 +476,7 @@ CREATE TABLE "GRAPHS" (
 );
 
 CREATE TABLE "ISSUES" (
-  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  "ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
   "KEE" VARCHAR(50) UNIQUE NOT NULL,
   "COMPONENT_ID" INTEGER NOT NULL,
   "ROOT_COMPONENT_ID" INTEGER,
@@ -503,7 +503,7 @@ CREATE TABLE "ISSUES" (
 );
 
 CREATE TABLE "ISSUE_CHANGES" (
-  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  "ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
   "KEE" VARCHAR(50),
   "ISSUE_KEY" VARCHAR(50) NOT NULL,
   "USER_LOGIN" VARCHAR(40),
diff --git a/sonar-server/src/main/webapp/WEB-INF/db/migrate/463_move_issues_id_to_bigint.rb b/sonar-server/src/main/webapp/WEB-INF/db/migrate/463_move_issues_id_to_bigint.rb
new file mode 100644 (file)
index 0000000..0cc92a9
--- /dev/null
@@ -0,0 +1,33 @@
+#
+# Sonar, entreprise quality control tool.
+# Copyright (C) 2008-2013 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.
+#
+
+#
+# Sonar 4.1
+# SONAR-4926
+#
+class MoveIssuesIdToBigint < ActiveRecord::Migration
+
+  def self.up
+    alter_to_big_primary_key('issues')
+    alter_to_big_primary_key('issue_changes')
+  end
+
+end
+