]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5896 Create database column to hold issue tags
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Mon, 8 Dec 2014 13:16:52 +0000 (14:16 +0100)
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>
Wed, 10 Dec 2014 08:21:16 +0000 (09:21 +0100)
20 files changed:
server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_insert_new_issues-result.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_update_issues-result.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/db/IssueDaoTest/insert-result.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/db/IssueDaoTest/update-result.xml
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/750_add_issues_tags_column.rb [new file with mode: 0644]
sonar-batch/src/test/resources/org/sonar/batch/issue/ScanIssueStorageTest/should_insert_new_issues-result.xml
sonar-batch/src/test/resources/org/sonar/batch/issue/ScanIssueStorageTest/should_resolve_conflicts_on_updates-result.xml
sonar-batch/src/test/resources/org/sonar/batch/issue/ScanIssueStorageTest/should_update_issues-result.xml
sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/testInsert-result.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/testUpdate-result.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueMapperTest/updateBeforeSelectedDate_with_conflict-result.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_insert_new_issues-result.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_update_issues-result.xml
sonar-core/src/test/resources/org/sonar/core/issue/db/IssueStorageTest/should_update_issues.xml
sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml
sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml
sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml

index bae0752883b502dc45d20ca6b2010ff251bd7413..dbf2cd99f780bdca308c41b1f012900fb13de874 100644 (file)
@@ -14,6 +14,7 @@
       updated_at="1000000000"
       reporter="emmerik"
       issue_attributes="foo=bar"
+      tags="[null]"
       action_plan_key="[null]"
       issue_creation_date="2013-05-18"
       issue_update_date="2013-05-18"
index 21a6c8061e3d96377ba9ad827ecaa66345ec2acc..47b4c1ce79ad00a544df261254893a00ae68509c 100644 (file)
@@ -19,6 +19,7 @@
           updated_at="2000000000"
           reporter="emmerik"
           issue_attributes="foo=bar"
+          tags="[null]"
           action_plan_key="[null]"
           issue_creation_date="2013-05-18 00:00:00.0"
           issue_update_date="2013-05-18 00:00:00.0"
index 6e6ab5c5cfb430e6cfc9148a4c3e34ed0b1c59fd..a6ea62afc7edf340c464a856bb902ece5a380b51 100644 (file)
@@ -18,6 +18,7 @@
       author_login="morgan"
       assignee="karadoc"
       issue_attributes="JIRA=FOO-1234"
+      tags="[null]"
       issue_creation_date="2013-05-18"
       issue_update_date="2013-05-19"
       issue_close_date="2013-05-20"
index ea43e6e66eafc3942df075cdd5e6ec8ff677b321..d50a2bc893edd0f125e78b90e437f0f680110657 100644 (file)
@@ -18,6 +18,7 @@
       author_login="morgan"
       assignee="karadoc"
       issue_attributes="JIRA=FOO-1234"
+      tags="[null]"
       issue_creation_date="2013-05-18"
       issue_update_date="2013-05-19"
       issue_close_date="2013-05-20"
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/750_add_issues_tags_column.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/750_add_issues_tags_column.rb
new file mode 100644 (file)
index 0000000..21f2bff
--- /dev/null
@@ -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 5.1
+# SONAR-5896
+#
+class AddIssuesTagsColumn < ActiveRecord::Migration
+
+  def self.up
+    add_column 'issues', :tags, :string, :null => true, :limit => 4000
+  end
+
+end
index 59d288be419ec5a4db2e00b8a1ccfeb687510030..458ce2553c26c00361bc95f3a79878d1cc2196fa 100644 (file)
@@ -14,6 +14,7 @@
       updated_at="[null]"
       reporter="emmerik"
       issue_attributes="foo=bar"
+      tags="[null]"
       action_plan_key="[null]"
       issue_creation_date="2013-05-18"
       issue_update_date="2013-05-18"
index c18f807642706bc9b9664fa483685c59e9416465..e421b224b5e2b25bc2d1b67e83150b11d7e889b4 100644 (file)
@@ -23,6 +23,7 @@
           rule_id="200"
           reporter="[null]"
           issue_attributes="JIRA=http://jira.com"
+          tags="[null]"
           action_plan_key="[null]"
           created_at="1400000000000"
           updated_at="1400000000000"
index 7cae675e9822e309a0d7546bf30f4a3f8f4f78c3..ba65e9df145d324c411687fb7a541eddf981c89b 100644 (file)
@@ -19,6 +19,7 @@
           updated_at="1400000000000"
           reporter="emmerik"
           issue_attributes="foo=bar"
+          tags="[null]"
           action_plan_key="[null]"
           issue_creation_date="2013-05-18 00:00:00.0"
           issue_update_date="2013-05-18 00:00:00.0"
index a0677316258df7ed8af2c01c2b543a9b999b014b..45e37dcad266b331acf4ce1ed9b8966e3f128cce 100644 (file)
@@ -33,7 +33,7 @@ import java.util.List;
  */
 public class DatabaseVersion implements BatchComponent, ServerComponent {
 
-  public static final int LAST_VERSION = 720;
+  public static final int LAST_VERSION = 750;
 
   /**
    * List of all the tables.
index 29605abdc40af860324676343edd0fcd5893f864..c59ac724e0e72f47c69eac4afbb7d86a90c65a71 100644 (file)
@@ -278,6 +278,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('717');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('718');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('719');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('720');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('750');
 
 INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '2011-09-26 22:27:48.0', '2011-09-26 22:27:48.0', null, null);
 ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;
index 0744edcbba50fdd285018ddd36cf5a21353df4cd..7e26868aaab2a347f28060800a0de84020f6ba95 100644 (file)
@@ -458,6 +458,7 @@ CREATE TABLE "ISSUES" (
   "AUTHOR_LOGIN" VARCHAR(255),
   "ACTION_PLAN_KEY" VARCHAR(50) NULL,
   "ISSUE_ATTRIBUTES" VARCHAR(4000),
+  "TAGS" VARCHAR(4000),
   "ISSUE_CREATION_DATE" TIMESTAMP,
   "ISSUE_CLOSE_DATE" TIMESTAMP,
   "ISSUE_UPDATE_DATE" TIMESTAMP,
index e82a348320776d34feba089ea98f085b10723735..de4d58f480874f7ee118acc150e954c5d63d0b02 100644 (file)
@@ -18,6 +18,7 @@
       author_login="morgan"
       assignee="karadoc"
       issue_attributes="JIRA=FOO-1234"
+      tags="[null]"
       issue_creation_date="2013-05-18"
       issue_update_date="2013-05-19"
       issue_close_date="2013-05-20"
index 2bb025d6f549bbaa2325db617195ecbd3808b396..ea66b875954b34e407ece89dc588b641cd4ca130 100644 (file)
@@ -18,6 +18,7 @@
       author_login="morgan"
       assignee="karadoc"
       issue_attributes="JIRA=FOO-1234"
+      tags="[null]"
       issue_creation_date="2013-05-18"
       issue_update_date="2013-05-19"
       issue_close_date="2013-05-20"
index d60c33118867b3bf866738969307346b942e0757..1cd6e6c18b4fd83f508305043533840cef6f1cc9 100644 (file)
@@ -19,6 +19,7 @@
       author_login="[null]"
       assignee="[null]"
       issue_attributes="[null]"
+      tags="[null]"
       issue_creation_date="[null]"
       issue_update_date="[null]"
       issue_close_date="[null]"
index 59d288be419ec5a4db2e00b8a1ccfeb687510030..458ce2553c26c00361bc95f3a79878d1cc2196fa 100644 (file)
@@ -14,6 +14,7 @@
       updated_at="[null]"
       reporter="emmerik"
       issue_attributes="foo=bar"
+      tags="[null]"
       action_plan_key="[null]"
       issue_creation_date="2013-05-18"
       issue_update_date="2013-05-18"
index 82db8eecb314c8f221cef1f61885d2ff1be19e2f..9127db20d63179bbc4679c10bb0d3cbaa8fdbffc 100644 (file)
@@ -19,6 +19,7 @@
           updated_at="2013-05-18"
           reporter="emmerik"
           issue_attributes="foo=bar"
+          tags="[null]"
           action_plan_key="[null]"
           issue_creation_date="2013-05-18 00:00:00.0"
           issue_update_date="2013-05-18 00:00:00.0"
index eff6dd5f3742a5471499c1891d171e89616a8c6a..58b3f183dc42709412ba64d76be4172062bb4b5a 100644 (file)
@@ -19,6 +19,7 @@
           updated_at="1400000000000"
           reporter="emmerik"
           issue_attributes="foo=bar"
+          tags="[null]"
           action_plan_key="[null]"
           issue_creation_date="2010-01-01"
           issue_update_date="2010-02-02"
index 0499ea1c91c1010f3301745fd773c5dc5744dc4f..fad19405bbbac375e5ac1d1639b2603a93fd239b 100644 (file)
@@ -62,7 +62,7 @@ What has been changed :
           issue_close_date="2014-04-09"
           resolution="REMOVED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
           message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
-          updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" created_at="1450000000000"/>
+          updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" created_at="1450000000000" tags="[null]"/>
 
   <!-- Open issue on directory -->
   <issues id="2" kee="ISSUE-2"
@@ -72,7 +72,7 @@ What has been changed :
           issue_close_date="2014-04-09"
           resolution="REMOVED" line="[null]" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
           message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
-          updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" created_at="1450000000000"/>
+          updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" created_at="1450000000000" tags="[null]"/>
 
   <!-- Open issue on project -->
   <issues id="3" kee="ISSUE-3"
@@ -82,7 +82,7 @@ What has been changed :
           issue_close_date="2014-04-09"
           resolution="REMOVED" line="[null]" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
           message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
-          updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" created_at="1450000000000"/>
+          updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-09" created_at="1450000000000" tags="[null]"/>
 
   <!-- Resolved issue on file -> not to be updated -->
   <issues id="4" kee="ISSUE-4"
@@ -92,6 +92,6 @@ What has been changed :
           issue_close_date="2015-12-08"
           resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
           message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
-          updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-08" created_at="1450000000000"/>
+          updated_at="1450000000000" issue_creation_date="2013-04-16" issue_update_date="2014-04-08" created_at="1450000000000" tags="[null]"/>
 
 </dataset>
index b72b131316b88c18bae4a2b3a7373e8f9beeedba..4b3e552e028d01bd778d16cffe766c2c934707ec 100644 (file)
@@ -49,7 +49,7 @@
           root_component_id="1"
           status="OPEN"
           issue_close_date="[null]"
-          resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
+          resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]"
           message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
           updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
   <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
@@ -60,7 +60,7 @@
           root_component_id="1"
           status="OPEN"
           issue_close_date="[null]"
-          resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
+          resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]"
           message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
           updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
   <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
index e9a164a0ec960e419710ff57e6eb54e6ecf1f798..7d2e4cd652eaa48246592939efc9bc6301d49d0a 100644 (file)
@@ -43,7 +43,7 @@
           root_component_id="1"
           status="OPEN"
           issue_close_date="[null]"
-          resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
+          resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]"
           message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
           updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
   <issue_changes id="3" kee="[null]" issue_key="ISSUE-3" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
@@ -54,7 +54,7 @@
           root_component_id="1"
           status="OPEN"
           issue_close_date="[null]"
-          resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
+          resolution="[null]" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]"
           message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
           updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
   <issue_changes id="4" kee="[null]" issue_key="ISSUE-4" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>
@@ -64,7 +64,7 @@
           root_component_id="1"
           status="CLOSED"
           issue_close_date="2025-01-01"
-          resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]"
+          resolution="FIXED" line="200" severity="BLOCKER" reporter="perceval" assignee="arthur" rule_id="500" manual_severity="[false]" tags="[null]"
           message="[null]" action_plan_key="[null]" effort_to_fix="[null]" technical_debt="[null]" issue_attributes="[null]" checksum="[null]" author_login="[null]"
           updated_at="[null]" issue_creation_date="2013-04-16" issue_update_date="2013-04-16" created_at="1400000000000"/>
   <issue_changes id="5" kee="[null]" issue_key="ISSUE-5" created_at="[null]" updated_at="[null]" user_login="admin" change_type="comment" change_data="abc" issue_change_creation_date="[null]"/>