From add94f37cdb24267d8773deb7e1beb6f31ac4b74 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Sun, 11 Sep 2016 17:59:58 +0200 Subject: [PATCH] SONAR-7851 drop table ACTIVITIES --- .../db/migrate/1318_drop_table_activities.rb | 31 +++++++++++++++++++ .../org/sonar/db/version/DatabaseVersion.java | 3 +- .../org/sonar/db/version/rows-h2.sql | 1 + .../org/sonar/db/version/schema-h2.ddl | 14 --------- 4 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1318_drop_table_activities.rb diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1318_drop_table_activities.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1318_drop_table_activities.rb new file mode 100644 index 00000000000..37d46bfc09c --- /dev/null +++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1318_drop_table_activities.rb @@ -0,0 +1,31 @@ +# +# 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 DropTableActivities < ActiveRecord::Migration + + def self.up + drop_index_quietly 'activities', 'activities_log_key' + drop_table 'activities' + 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 12f111a480a..7e5a27c3e0b 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_317; + public static final int LAST_VERSION = 1_318; /** * The minimum supported version which can be upgraded. Lower @@ -48,7 +48,6 @@ public class DatabaseVersion { "active_dashboards", "active_rules", "active_rule_parameters", - "activities", "authors", "ce_activity", "ce_queue", 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 e44e43e6b5e..7310b9b985e 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 @@ -502,6 +502,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1314'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1315'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1316'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1317'); +INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1318'); 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 6569864cb03..e3c74e61ba1 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 @@ -489,18 +489,6 @@ CREATE TABLE "PERM_TEMPLATES_GROUPS" ( ); -CREATE TABLE "ACTIVITIES" ( - "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), - "LOG_KEY" VARCHAR(250), - "PROFILE_KEY" VARCHAR(255) NOT NULL, - "CREATED_AT" TIMESTAMP, - "USER_LOGIN" VARCHAR(255), - "LOG_TYPE" VARCHAR(250), - "LOG_ACTION" VARCHAR(250), - "LOG_MESSAGE" VARCHAR(250), - "DATA_FIELD" CLOB(2147483647) -); - CREATE TABLE "QPROFILE_CHANGES" ( "KEE" VARCHAR(40) NOT NULL PRIMARY KEY, "QPROFILE_KEY" VARCHAR(255) NOT NULL, @@ -582,8 +570,6 @@ CREATE TABLE "USER_TOKENS" ( -- DDL Statements for indexes -- ---------------------------------------------- -CREATE UNIQUE INDEX "ACTIVITIES_LOG_KEY" ON "ACTIVITIES" ("LOG_KEY"); - CREATE INDEX "GROUP_ROLES_RESOURCE" ON "GROUP_ROLES" ("RESOURCE_ID"); CREATE INDEX "USER_ROLES_RESOURCE" ON "USER_ROLES" ("RESOURCE_ID"); -- 2.39.5