aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-06-24 00:15:21 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-06-24 00:26:49 +0200
commit5470fe5d8afd1f29980312dcd90eaf8ecb873155 (patch)
treebe572963bec85161acc44e5bf3ec0a4a88f8799c /sonar-core
parent78f2909b5ef26d889c16423a05e1e3371244861c (diff)
downloadsonarqube-5470fe5d8afd1f29980312dcd90eaf8ecb873155.tar.gz
sonarqube-5470fe5d8afd1f29980312dcd90eaf8ecb873155.zip
SONAR-5007 add EVENTS.EVENT_DATA to store links on quality profile changes
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql1
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/schema-h2.ddl3
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/should_create_database.xml6
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml2
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml4
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml6
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml6
-rw-r--r--sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldSelectPurgeableSnapshots.xml5
11 files changed, 24 insertions, 17 deletions
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 bfc0a38e095..c7ff86a5f0c 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 = 554;
+ public static final int LAST_VERSION = 555;
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/rows-h2.sql b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
index 0acc327fe71..e93794de62f 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
@@ -247,6 +247,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('551');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('552');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('553');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('554');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('555');
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;
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 d9335527a23..a740173f02b 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
@@ -177,7 +177,8 @@ CREATE TABLE "EVENTS" (
"CATEGORY" VARCHAR(50),
"EVENT_DATE" TIMESTAMP,
"CREATED_AT" TIMESTAMP,
- "DESCRIPTION" VARCHAR(4000)
+ "DESCRIPTION" VARCHAR(4000),
+ "EVENT_DATA" VARCHAR(4000)
);
CREATE TABLE "QUALITY_GATES" (
diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
index e7362ab8fcd..01b31759a94 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -387,7 +387,7 @@ project_links.scm_dev=Developer connection
event.category.Version=Version
event.category.Alert=Quality Gate
-event.category.Profile=Profile
+event.category.Profile=Quality Profile
event.category.Other=Other
diff --git a/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/should_create_database.xml b/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/should_create_database.xml
index 897c196100f..abae88d3a70 100644
--- a/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/should_create_database.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/persistence/PreviewDatabaseFactoryTest/should_create_database.xml
@@ -22,9 +22,9 @@
<project_measures id="1" value="10" metric_id="1" snapshot_id="1000" />
- <events id="1" name="1.0-SNAPSHOT" resource_id="123" />
- <events id="2" name="2.0-SNAPSHOT" resource_id="123" />
- <events id="3" name="1.0-SNAPSHOT" resource_id="456" />
+ <events id="1" name="1.0-SNAPSHOT" resource_id="123" event_data="[null]"/>
+ <events id="2" name="2.0-SNAPSHOT" resource_id="123" event_data="[null]" />
+ <events id="3" name="1.0-SNAPSHOT" resource_id="456" event_data="[null]" />
<users id="1" login="julien" name="Julien" crypted_password="foo" active="1" />
<users id="2" login="simon" name="Simon" active="1" />
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml
index 2827a85e45f..17cab18f334 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteResource.xml
@@ -16,7 +16,7 @@
version="[null]" path="[null]"/>
<events id="1" name="Version 1.0" resource_id="1" snapshot_id="1" category="VERSION" description="[null]"
- event_date="2008-12-02 13:58:00.00" created_at="[null]"/>
+ event_date="2008-12-02 13:58:00.00" created_at="[null]" event_data="[null]"/>
<issues id="1" kee="ABCDE" component_id="1" status="CLOSED" resolution="[null]" line="200" severity="BLOCKER"
reporter="perceval" assignee="arthur" rule_id="500"
@@ -33,4 +33,4 @@
<authors id="1" person_id="1" login="tartanpion" created_at="[null]" updated_at="[null]" />
<authors id="2" person_id="1" login="fanfoue" created_at="[null]" updated_at="[null]" />
-</dataset> \ No newline at end of file
+</dataset>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml
index dbbab34b4f9..9987056896c 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml
@@ -27,7 +27,7 @@
parent_dependency_id="[null]" project_snapshot_id="1"
dep_usage="USES" dep_weight="1" from_scope="PRJ" to_scope="LIB"/>
<events id="1" name="Version 1.0" resource_id="1" snapshot_id="1" category="VERSION" description="[null]"
- event_date="2008-12-02 13:58:00.00" created_at="[null]"/>
+ event_date="2008-12-02 13:58:00.00" created_at="[null]" event_data="[null]"/>
<duplications_index id="1" project_snapshot_id="1" snapshot_id="1" hash="bb" index_in_file="0" start_line="0" end_line="0"/>
<snapshot_data id="1" resource_id="1" snapshot_id="1" snapshot_data="0,10,k" data_type="highlight_syntax" created_at="[null]" updated_at="[null]" />
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml
index bfdbc9c5f63..501a124192c 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml
@@ -25,7 +25,7 @@
parent_dependency_id="[null]" project_snapshot_id="1"
dep_usage="USES" dep_weight="1" from_scope="PRJ" to_scope="LIB"/>
<events id="1" name="Version 1.0" resource_id="1" snapshot_id="1" category="VERSION" description="[null]"
- event_date="2008-12-02 13:58:00.00" created_at="[null]"/>
+ event_date="2008-12-02 13:58:00.00" created_at="[null]" event_data="[null]"/>
<duplications_index id="1" project_snapshot_id="1" snapshot_id="1" hash="bb" index_in_file="0" start_line="0" end_line="0"/>
<snapshot_data id="1" resource_id="1" snapshot_id="1" snapshot_data="0,10,k" data_type="highlight_syntax" created_at="[null]" updated_at="[null]" />
@@ -58,7 +58,7 @@
parent_dependency_id="[null]" project_snapshot_id="5"
dep_usage="USES" dep_weight="1" from_scope="PRJ" to_scope="LIB"/>
<events id="2" name="Version 1.0" resource_id="5" snapshot_id="5" category="VERSION" description="[null]"
- event_date="2008-12-02 13:58:00.00" created_at="[null]"/>
+ event_date="2008-12-02 13:58:00.00" created_at="[null]" event_data="[null]"/>
<duplications_index id="2" project_snapshot_id="5" snapshot_id="5" hash="bb" index_in_file="0" start_line="0" end_line="0"/>
<snapshot_data id="2" resource_id="5" snapshot_id="5" snapshot_data="0,10,k" data_type="highlight_syntax" created_at="[null]" updated_at="[null]" />
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml
index 54257ab7f5d..f2ab60752db 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml
@@ -40,7 +40,8 @@ Note that measures, events and reviews are not deleted.
<!--dep_usage="USES" dep_weight="1" from_scope="LIB" to_scope="PRJ"/>-->
<events id="1" resource_id="1" snapshot_id="1"
- category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"/>
+ category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"
+ event_data="[null]"/>
<!--<duplications_index id="1" project_snapshot_id="1" snapshot_id="1"-->
<!--hash="bb" index_in_file="0" start_line="0" end_line="0"/>-->
@@ -74,7 +75,8 @@ Note that measures, events and reviews are not deleted.
dep_usage="USES" dep_weight="1" from_scope="LIB" to_scope="PRJ"/>
<events id="2" resource_id="2" snapshot_id="2"
- category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"/>
+ category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"
+ event_data="[null]"/>
<duplications_index id="2" project_snapshot_id="2" snapshot_id="2"
hash="bb" index_in_file="0" start_line="0" end_line="0"/>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml
index 4a2123e1412..5b651f5ea32 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml
@@ -27,7 +27,8 @@
dep_usage="USES" dep_weight="1" from_scope="LIB" to_scope="PRJ"/>
<events id="1" resource_id="1" snapshot_id="1"
- category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"/>
+ category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"
+ event_data="[null]"/>
<duplications_index id="1" project_snapshot_id="1" snapshot_id="1"
hash="bb" index_in_file="0" start_line="0" end_line="0"/>
@@ -63,7 +64,8 @@
dep_usage="USES" dep_weight="1" from_scope="LIB" to_scope="PRJ"/>
<events id="2" resource_id="2" snapshot_id="2"
- category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"/>
+ category="VERSION" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"
+ event_data="[null]"/>
<duplications_index id="2" project_snapshot_id="2" snapshot_id="2"
hash="bb" index_in_file="0" start_line="0" end_line="0"/>
diff --git a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldSelectPurgeableSnapshots.xml b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldSelectPurgeableSnapshots.xml
index 4ea5c8e1726..bd873bcdc57 100644
--- a/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldSelectPurgeableSnapshots.xml
+++ b/sonar-core/src/test/resources/org/sonar/core/purge/PurgeDaoTest/shouldSelectPurgeableSnapshots.xml
@@ -56,6 +56,7 @@
depth="[null]" scope="PRJ" qualifier="TRK" created_at="2008-12-02 13:58:00.00" build_date="2008-12-02 13:58:00.00" version="[null]" path="[null]"/>
<events id="2" resource_id="1" snapshot_id="5"
- category="Version" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"/>
+ category="Version" description="[null]" name="Version 1.0" event_date="2008-12-02 13:58:00.00" created_at="[null]"
+ event_data="[null]"/>
-</dataset> \ No newline at end of file
+</dataset>