aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-09-30 11:39:34 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-09-30 13:05:46 +0200
commita4d652253d8f3e55c1903c0bf4bb513a100ebbf1 (patch)
tree2cd16de7b722b535f5bff4d69703986e7b5de258 /sonar-db
parent7a9d22a005d1f0b80a161149c967f149576a46ac (diff)
downloadsonarqube-a4d652253d8f3e55c1903c0bf4bb513a100ebbf1.tar.gz
sonarqube-a4d652253d8f3e55c1903c0bf4bb513a100ebbf1.zip
SONAR-6834 Rename column CE_ACTIVITY.FINISHED_AT to EXECUTED_AT
Diffstat (limited to 'sonar-db')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/ce/CeActivityDto.java12
-rw-r--r--sonar-db/src/main/java/org/sonar/db/ce/CeActivityQuery.java10
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/ce/CeActivityMapper.xml14
-rw-r--r--sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl14
-rw-r--r--sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java14
5 files changed, 26 insertions, 38 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/ce/CeActivityDto.java b/sonar-db/src/main/java/org/sonar/db/ce/CeActivityDto.java
index db2f1a10c39..35133e20db0 100644
--- a/sonar-db/src/main/java/org/sonar/db/ce/CeActivityDto.java
+++ b/sonar-db/src/main/java/org/sonar/db/ce/CeActivityDto.java
@@ -42,7 +42,7 @@ public class CeActivityDto {
private String submitterLogin;
private long submittedAt;
private Long startedAt;
- private Long finishedAt;
+ private Long executedAt;
private long createdAt;
private long updatedAt;
private Long executionTimeMs;
@@ -131,12 +131,12 @@ public class CeActivityDto {
}
@CheckForNull
- public Long getFinishedAt() {
- return finishedAt;
+ public Long getExecutedAt() {
+ return executedAt;
}
- public void setFinishedAt(@Nullable Long l) {
- this.finishedAt = l;
+ public void setExecutedAt(@Nullable Long l) {
+ this.executedAt = l;
}
public long getCreatedAt() {
@@ -177,7 +177,7 @@ public class CeActivityDto {
.add("submitterLogin", submitterLogin)
.add("submittedAt", submittedAt)
.add("startedAt", startedAt)
- .add("finishedAt", finishedAt)
+ .add("executedAt", executedAt)
.add("createdAt", createdAt)
.add("updatedAt", updatedAt)
.add("executionTimeMs", executionTimeMs)
diff --git a/sonar-db/src/main/java/org/sonar/db/ce/CeActivityQuery.java b/sonar-db/src/main/java/org/sonar/db/ce/CeActivityQuery.java
index 04f6d0ca7f4..355439d9ae2 100644
--- a/sonar-db/src/main/java/org/sonar/db/ce/CeActivityQuery.java
+++ b/sonar-db/src/main/java/org/sonar/db/ce/CeActivityQuery.java
@@ -29,7 +29,7 @@ public class CeActivityQuery {
private CeActivityDto.Status status;
private String type;
private Long minSubmittedAt;
- private Long maxFinishedAt;
+ private Long maxExecutedAt;
@CheckForNull
public String getComponentUuid() {
@@ -71,12 +71,12 @@ public class CeActivityQuery {
}
@CheckForNull
- public Long getMaxFinishedAt() {
- return maxFinishedAt;
+ public Long getMaxExecutedAt() {
+ return maxExecutedAt;
}
- public CeActivityQuery setMaxFinishedAt(@Nullable Long l) {
- this.maxFinishedAt = l;
+ public CeActivityQuery setMaxExecutedAt(@Nullable Long l) {
+ this.maxExecutedAt = l;
return this;
}
diff --git a/sonar-db/src/main/resources/org/sonar/db/ce/CeActivityMapper.xml b/sonar-db/src/main/resources/org/sonar/db/ce/CeActivityMapper.xml
index c466d93cbcc..3c10c891e62 100644
--- a/sonar-db/src/main/resources/org/sonar/db/ce/CeActivityMapper.xml
+++ b/sonar-db/src/main/resources/org/sonar/db/ce/CeActivityMapper.xml
@@ -11,7 +11,7 @@
ca.submitter_login as submitterLogin,
ca.submitted_at as submittedAt,
ca.started_at as startedAt,
- ca.finished_at as finishedAt,
+ ca.executed_at as executedAt,
ca.created_at as createdAt,
ca.updated_at as updatedAt,
ca.is_last as isLast,
@@ -61,8 +61,8 @@
<if test="query.minSubmittedAt != null">
and ca.submitted_at &gt;= #{query.minSubmittedAt}
</if>
- <if test="query.maxFinishedAt != null">
- and ca.finished_at &lt;= #{query.maxFinishedAt}
+ <if test="query.maxExecutedAt != null">
+ and ca.executed_at &lt;= #{query.maxExecutedAt}
</if>
</where>
order by ca.id desc
@@ -87,8 +87,8 @@
<if test="query.minSubmittedAt != null">
and ca.submitted_at &gt;= #{query.minSubmittedAt}
</if>
- <if test="query.maxFinishedAt != null">
- and ca.finished_at &lt;= #{query.maxFinishedAt}
+ <if test="query.maxExecutedAt != null">
+ and ca.executed_at &lt;= #{query.maxExecutedAt}
</if>
</where>
</select>
@@ -102,7 +102,7 @@
<insert id="insert" parameterType="org.sonar.db.ce.CeActivityDto" useGeneratedKeys="false">
insert into ce_activity
(uuid, component_uuid, status, task_type, is_last, is_last_key, submitter_login, submitted_at, started_at,
- finished_at, created_at, updated_at, execution_time_ms)
+ executed_at, created_at, updated_at, execution_time_ms)
values (
#{uuid,jdbcType=VARCHAR},
#{componentUuid,jdbcType=VARCHAR},
@@ -113,7 +113,7 @@
#{submitterLogin,jdbcType=VARCHAR},
#{submittedAt,jdbcType=BIGINT},
#{startedAt,jdbcType=BIGINT},
- #{finishedAt,jdbcType=BIGINT},
+ #{executedAt,jdbcType=BIGINT},
#{createdAt,jdbcType=BIGINT},
#{updatedAt,jdbcType=BIGINT},
#{executionTimeMs,jdbcType=BIGINT}
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 2ef8f08a9ce..f68481ba36e 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
@@ -508,18 +508,6 @@ CREATE TABLE "ACTIVITIES" (
"DATA_FIELD" CLOB(2147483647)
);
-CREATE TABLE "ANALYSIS_REPORTS" (
- "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
- "PROJECT_KEY" VARCHAR(400) NOT NULL,
- "PROJECT_NAME" VARCHAR(256) NULL,
- "REPORT_STATUS" VARCHAR(20) NOT NULL,
- "UUID" VARCHAR(50) NOT NULL,
- "CREATED_AT" BIGINT NOT NULL,
- "UPDATED_AT" BIGINT NOT NULL,
- "STARTED_AT" BIGINT,
- "FINISHED_AT" BIGINT
-);
-
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,
@@ -557,7 +545,7 @@ CREATE TABLE "CE_ACTIVITY" (
"SUBMITTER_LOGIN" VARCHAR(255) NULL,
"SUBMITTED_AT" BIGINT NOT NULL,
"STARTED_AT" BIGINT NULL,
- "FINISHED_AT" BIGINT NULL,
+ "EXECUTED_AT" BIGINT NULL,
"CREATED_AT" BIGINT NOT NULL,
"UPDATED_AT" BIGINT NOT NULL,
"EXECUTION_TIME_MS" BIGINT NULL
diff --git a/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java b/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java
index e714e688bf1..6138e4de2ea 100644
--- a/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java
+++ b/sonar-db/src/test/java/org/sonar/db/ce/CeActivityDaoTest.java
@@ -58,7 +58,7 @@ public class CeActivityDaoTest {
assertThat(saved.get().getSubmittedAt()).isEqualTo(1_300_000_000_000L);
assertThat(saved.get().getCreatedAt()).isEqualTo(1_450_000_000_000L);
assertThat(saved.get().getStartedAt()).isEqualTo(1_500_000_000_000L);
- assertThat(saved.get().getFinishedAt()).isEqualTo(1_500_000_000_500L);
+ assertThat(saved.get().getExecutedAt()).isEqualTo(1_500_000_000_500L);
assertThat(saved.get().getExecutionTimeMs()).isEqualTo(500L);
}
@@ -155,28 +155,28 @@ public class CeActivityDaoTest {
assertThat(underTest.selectByQuery(db.getSession(), query, new RowBounds(0, 10))).extracting("uuid").containsOnly("UUID2");
assertThat(underTest.countByQuery(db.getSession(), query)).isEqualTo(1);
- // search by max finished date
- query = new CeActivityQuery().setMaxFinishedAt(1_475_000_000_000L);
+ // search by max executed date
+ query = new CeActivityQuery().setMaxExecutedAt(1_475_000_000_000L);
assertThat(underTest.selectByQuery(db.getSession(), query, new RowBounds(0, 10))).extracting("uuid").containsOnly("UUID1");
assertThat(underTest.countByQuery(db.getSession(), query)).isEqualTo(1);
// search by both dates
query = new CeActivityQuery()
.setMinSubmittedAt(1_400_000_000_000L)
- .setMaxFinishedAt(1_475_000_000_000L);
+ .setMaxExecutedAt(1_475_000_000_000L);
assertThat(underTest.selectByQuery(db.getSession(), query, new RowBounds(0, 10))).extracting("uuid").containsOnly("UUID1");
assertThat(underTest.countByQuery(db.getSession(), query)).isEqualTo(1);
}
- private void insertWithDates(String uuid, long submittedAt, long finishedAt) {
+ private void insertWithDates(String uuid, long submittedAt, long executedAt) {
CeQueueDto queueDto = new CeQueueDto();
queueDto.setUuid(uuid);
queueDto.setTaskType("fake");
CeActivityDto dto = new CeActivityDto(queueDto);
dto.setStatus(CeActivityDto.Status.SUCCESS);
dto.setSubmittedAt(submittedAt);
- dto.setFinishedAt(finishedAt);
+ dto.setExecutedAt(executedAt);
underTest.insert(db.getSession(), dto);
}
@@ -221,7 +221,7 @@ public class CeActivityDaoTest {
CeActivityDto dto = new CeActivityDto(queueDto);
dto.setStatus(status);
dto.setStartedAt(1_500_000_000_000L);
- dto.setFinishedAt(1_500_000_000_500L);
+ dto.setExecutedAt(1_500_000_000_500L);
dto.setExecutionTimeMs(500L);
underTest.insert(db.getSession(), dto);
}