summaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorStephane Gamard <stephane.gamard@searchbox.com>2014-06-16 16:42:47 +0200
committerStephane Gamard <stephane.gamard@searchbox.com>2014-06-16 16:42:47 +0200
commiteaf2d48216a07e48e3fa498e3a4161561346f3db (patch)
tree39c5ddc8f0c7e88633694291da6c8dd57363b76f /sonar-core
parentb072af0820d872792808ee662fceb1e2e37122d8 (diff)
downloadsonarqube-eaf2d48216a07e48e3fa498e3a4161561346f3db.tar.gz
sonarqube-eaf2d48216a07e48e3fa498e3a4161561346f3db.zip
SONAR-5329 -Removed Key and ExecutionTime fields from Activity
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/activity/Activity.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/activity/ActivityLog.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/activity/db/ActivityDto.java10
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/activity/db/ActivityMapper.xml18
-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
8 files changed, 13 insertions, 27 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/activity/Activity.java b/sonar-core/src/main/java/org/sonar/core/activity/Activity.java
index b80fdd15722..fac77c44e0d 100644
--- a/sonar-core/src/main/java/org/sonar/core/activity/Activity.java
+++ b/sonar-core/src/main/java/org/sonar/core/activity/Activity.java
@@ -35,8 +35,6 @@ public interface Activity {
String author();
- Integer executionTime();
-
Map<String, String> details();
String message();
diff --git a/sonar-core/src/main/java/org/sonar/core/activity/ActivityLog.java b/sonar-core/src/main/java/org/sonar/core/activity/ActivityLog.java
index f55aee14f43..eae04476a95 100644
--- a/sonar-core/src/main/java/org/sonar/core/activity/ActivityLog.java
+++ b/sonar-core/src/main/java/org/sonar/core/activity/ActivityLog.java
@@ -28,6 +28,4 @@ public interface ActivityLog {
Map<String, String> getDetails();
- int getExecutionTime();
-
}
diff --git a/sonar-core/src/main/java/org/sonar/core/activity/db/ActivityDto.java b/sonar-core/src/main/java/org/sonar/core/activity/db/ActivityDto.java
index 3d7d1cedaaf..4427c45e8e2 100644
--- a/sonar-core/src/main/java/org/sonar/core/activity/db/ActivityDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/activity/db/ActivityDto.java
@@ -35,8 +35,6 @@ public final class ActivityDto extends Dto<ActivityKey> {
private Activity.Type type;
private String author;
- private Integer executionTime;
-
private String data;
protected ActivityDto() {
@@ -70,12 +68,7 @@ public final class ActivityDto extends Dto<ActivityKey> {
return this;
}
- public Integer getExecutionTime() {
- return executionTime;
- }
-
public ActivityDto setExecutionTime(Integer executionTime) {
- this.executionTime = executionTime;
return this;
}
@@ -104,7 +97,6 @@ public final class ActivityDto extends Dto<ActivityKey> {
public static ActivityDto createFor(ActivityLog activityLog) {
return new ActivityDto()
- .setData(KeyValueFormat.format(activityLog.getDetails()))
- .setExecutionTime(activityLog.getExecutionTime());
+ .setData(KeyValueFormat.format(activityLog.getDetails()));
}
}
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 1b5b35b8749..3fd3a78ab52 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 = 547;
+ public static final int LAST_VERSION = 548;
public static enum Status {
UP_TO_DATE, REQUIRES_UPGRADE, REQUIRES_DOWNGRADE, FRESH_INSTALL
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
index 154fbac7bd8..e438cf7ca03 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/MyBatis.java
@@ -203,7 +203,7 @@ public class MyBatis implements BatchComponent, ServerComponent {
loadAlias(conf, "ActiveRule", ActiveRuleDto.class);
loadAlias(conf, "ActiveRuleParam", ActiveRuleParamDto.class);
loadAlias(conf, "RequirementMigration", RequirementMigrationDto.class);
- loadAlias(conf, "Log", ActivityDto.class);
+ loadAlias(conf, "Activity", ActivityDto.class);
// AuthorizationMapper has to be loaded before IssueMapper because this last one used it
loadMapper(conf, "org.sonar.core.user.AuthorizationMapper");
diff --git a/sonar-core/src/main/resources/org/sonar/core/activity/db/ActivityMapper.xml b/sonar-core/src/main/resources/org/sonar/core/activity/db/ActivityMapper.xml
index 4595d9288c9..b532f946bce 100644
--- a/sonar-core/src/main/resources/org/sonar/core/activity/db/ActivityMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/activity/db/ActivityMapper.xml
@@ -3,35 +3,33 @@
<mapper namespace="org.sonar.core.activity.db.ActivityMapper">
-<insert id="insert" parameterType="Log" useGeneratedKeys="false" lang="raw">
- insert into logs
- (created_at, log_type,execution_time_field,user_login,data_field, log_message)
- values (#{createdAt}, #{type}, #{executionTime}, #{author}, #{data}, #{message})
+ <insert id="insert" parameterType="Activity" useGeneratedKeys="false" lang="raw">
+ insert into activities
+ (created_at, log_type,user_login,data_field, log_message)
+ values (#{createdAt}, #{type}, #{author}, #{data}, #{message})
</insert>
- <select id="selectByKey" parameterType="map" resultType="Log" lang="raw">
+ <select id="selectByKey" parameterType="map" resultType="Activity" lang="raw">
SELECT
l.created_at as "createdAt",
l.log_type as "type",
- l.execution_time_field as "executionTime",
l.user_login as "author",
l.data_field as "data",
l.log_message as "message"
- FROM logs l
+ FROM activities l
WHERE l.created_at=#{key.createdAt}
AND l.user_login=#{key.author}
AND l.log_type=#{key.type}
</select>
- <select id="selectAll" parameterType="map" resultType="Log" lang="raw">
+ <select id="selectAll" parameterType="map" resultType="Activity" lang="raw">
SELECT
l.created_at as "createdAt",
l.log_type as "type",
- l.execution_time_field as "executionTime",
l.user_login as "author",
l.data_field as "data",
l.log_message as "message"
- FROM logs l
+ FROM activities l
</select>
</mapper>
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 994144ca8f1..dc37a6e684a 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
@@ -242,6 +242,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('544');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('545');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('546');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('547');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('548');
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 a609cd530b5..9d2566dfb29 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
@@ -552,9 +552,8 @@ CREATE TABLE "PERM_TEMPLATES_GROUPS" (
);
-CREATE TABLE "LOGS" (
+CREATE TABLE "ACTIVITIES" (
"CREATED_AT" TIMESTAMP,
- "EXECUTION_TIME_FIELD" LONG,
"USER_LOGIN" VARCHAR(30),
"LOG_TYPE" VARCHAR(250),
"LOG_MESSAGE" VARCHAR(250),