aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-08-25 11:20:39 +0200
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>2016-08-29 09:47:48 +0200
commit349dc013f9bec35932baa075d86104832a33d35b (patch)
tree19c0e3d629c2a612cf39dd416afba68b30003c01
parentebf15f10287a07cc593233132f930616e29fd6be (diff)
downloadsonarqube-349dc013f9bec35932baa075d86104832a33d35b.tar.gz
sonarqube-349dc013f9bec35932baa075d86104832a33d35b.zip
SONAR-7844 rename to CE_SCANNER_CONTEXT + task_uuid as PK
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1309_recreate_table_scanner_context.rb37
-rw-r--r--sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java7
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql1
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl14
4 files changed, 48 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1309_recreate_table_scanner_context.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1309_recreate_table_scanner_context.rb
new file mode 100644
index 00000000000..7dcea324a6e
--- /dev/null
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1309_recreate_table_scanner_context.rb
@@ -0,0 +1,37 @@
+#
+# 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.1
+#
+class RecreateTableScannerContext < ActiveRecord::Migration
+
+ def self.up
+ drop_table 'scanner_context'
+
+ create_table 'ce_scanner_context', :id => false do |t|
+ t.column 'task_uuid', :string, :limit => 40, :null => false
+ t.column 'data', :binary, :null => false
+ t.column 'created_at', :big_integer, :null => false
+ t.column 'updated_at', :big_integer, :null => false
+ end
+ add_primary_key 'ce_scanner_context', 'task_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 5cfbc9481ce..1d2941e5c32 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_308;
+ public static final int LAST_VERSION = 1_309;
/**
* The minimum supported version which can be upgraded. Lower
@@ -53,6 +53,7 @@ public class DatabaseVersion {
"ce_activity",
"ce_queue",
"ce_task_input",
+ "ce_scanner_context",
"dashboards",
"duplications_index",
"events",
@@ -85,15 +86,13 @@ public class DatabaseVersion {
"rules",
"rules_parameters",
"rules_profiles",
- "scanner_context",
"schema_migrations",
"snapshots",
"users",
"user_roles",
"user_tokens",
"widgets",
- "widget_properties"
- );
+ "widget_properties");
private MyBatis mybatis;
public DatabaseVersion(MyBatis mybatis) {
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 9070689515f..570a78cfaac 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
@@ -494,6 +494,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1304');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1306');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1307');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1308');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1309');
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 6f3da62994d..afbe2031221 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
@@ -81,13 +81,6 @@ CREATE TABLE "SNAPSHOTS" (
"PERIOD5_DATE" BIGINT
);
-CREATE TABLE "SCANNER_CONTEXT" (
- "ANALYSIS_UUID" VARCHAR(40) NOT NULL PRIMARY KEY,
- "DATA" BLOB(167772150) NOT NULL,
- "CREATED_AT" BIGINT NOT NULL,
- "UPDATED_AT" BIGINT NOT NULL
-);
-
CREATE TABLE "SCHEMA_MIGRATIONS" (
"VERSION" VARCHAR(256) NOT NULL
);
@@ -550,6 +543,13 @@ CREATE TABLE "CE_TASK_INPUT" (
"UPDATED_AT" BIGINT NOT NULL
);
+CREATE TABLE "CE_SCANNER_CONTEXT" (
+ "TASK_UUID" VARCHAR(40) NOT NULL PRIMARY KEY,
+ "DATA" BLOB(167772150) NOT NULL,
+ "CREATED_AT" BIGINT NOT NULL,
+ "UPDATED_AT" BIGINT NOT NULL
+);
+
CREATE TABLE "USER_TOKENS" (
"ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
"LOGIN" VARCHAR(255) NOT NULL,