]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7851 create table qprofile_changes
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 9 Sep 2016 08:07:35 +0000 (10:07 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 12 Sep 2016 12:11:58 +0000 (14:11 +0200)
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1316_create_table_qprofile_changes.rb [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl

diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1316_create_table_qprofile_changes.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1316_create_table_qprofile_changes.rb
new file mode 100644 (file)
index 0000000..1d9a88d
--- /dev/null
@@ -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 CreateTableQprofileChanges < ActiveRecord::Migration
+
+  def self.up
+    create_table 'qprofile_changes', :id => false do |t|
+      t.column 'kee', :string, :limit => 40, :null => false
+      t.column 'qprofile_key', :string, :limit => 40, :null => false
+      t.column 'change_type', :string, :limit => 20, :null => false
+      t.column 'created_at', :big_integer, :null => false
+      t.column 'user_login', :string, :limit => 255, :null => true
+      t.column 'data', :text, :null => true
+    end
+    add_primary_key 'qprofile_changes', 'kee'
+  end
+end
index 223a31f3da1a2a9b703fc647f070bb211a8dda29..34cd448686efd364ba12224466c2a9b92b8969d5 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.db.MyBatis;
 
 public class DatabaseVersion {
 
-  public static final int LAST_VERSION = 1_315;
+  public static final int LAST_VERSION = 1_316;
 
   /**
    * The minimum supported version which can be upgraded. Lower
@@ -61,6 +61,7 @@ public class DatabaseVersion {
     "groups",
     "groups_users",
     "group_roles",
+    "internal_properties",
     "issues",
     "issue_changes",
     "issue_filters",
@@ -82,7 +83,7 @@ public class DatabaseVersion {
     "project_measures",
     "project_qprofiles",
     "properties",
-    "internal_properties",
+    "qprofile_changes",
     "resource_index",
     "rules",
     "rules_parameters",
index 490f32a10307f6a7cfdfa46a0308b07f0273597b..f5c3897d4da5fcc9ebd04e528667cabf1cb05a5f 100644 (file)
@@ -500,6 +500,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1312');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1313');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1314');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1315');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1316');
 
 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;
index ce442a993096b7ed65c5902f11ba083b9bac16d1..6569864cb03bd9e20853620f8105e825cbf8cdc5 100644 (file)
@@ -501,6 +501,15 @@ CREATE TABLE "ACTIVITIES" (
   "DATA_FIELD" CLOB(2147483647)
 );
 
+CREATE TABLE "QPROFILE_CHANGES" (
+  "KEE" VARCHAR(40) NOT NULL PRIMARY KEY,
+  "QPROFILE_KEY" VARCHAR(255) NOT NULL,
+  "CHANGE_TYPE" VARCHAR(20) NOT NULL,
+  "CREATED_AT" BIGINT NOT NULL,
+  "USER_LOGIN" VARCHAR(255),
+  "DATA" CLOB
+);
+
 CREATE TABLE "FILE_SOURCES" (
   "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
   "PROJECT_UUID" VARCHAR(50) NOT NULL,
@@ -714,3 +723,5 @@ CREATE INDEX "CE_ACTIVITY_ISLAST_STATUS" ON "CE_ACTIVITY" ("IS_LAST", "STATUS");
 CREATE UNIQUE INDEX "UNIQ_PERM_TPL_CHARAC" ON "PERM_TPL_CHARACTERISTICS" ("TEMPLATE_ID", "PERMISSION_KEY");
 
 CREATE UNIQUE INDEX "UNIQ_INTERNAL_PROPERTIES" ON "INTERNAL_PROPERTIES" ("KEE");
+
+CREATE INDEX "QPROFILE_CHANGES_QPROFILE_KEY" ON "QPROFILE_CHANGES" ("QPROFILE_KEY");