From: Simon Brandhof Date: Thu, 28 Nov 2013 20:29:08 +0000 (+0100) Subject: SONAR-4926 Primary key of the table ISSUES is too short X-Git-Tag: 4.1-RC1~172 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ee26063e9c387580b8db0812abe944ea58ca7729;p=sonarqube.git SONAR-4926 Primary key of the table ISSUES is too short --- 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 7af4c474942..6ddf2dbc146 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 = 462; + public static final int LAST_VERSION = 463; public static enum Status { UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL 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 4eff6867b75..1abb68dedc5 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 @@ -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 index 00000000000..0cc92a9dfb3 --- /dev/null +++ b/sonar-server/src/main/webapp/WEB-INF/db/migrate/463_move_issues_id_to_bigint.rb @@ -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 +