aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-03-29 19:48:01 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-03-29 19:49:06 +0200
commitb9f8b710d6f7c3ae5799fbacb9e93403b3babf08 (patch)
treefc32402b86ec51d5c1888c3490d246527fc8e31a /sonar-core
parent77661fd38dc63b1fae965733fbda8a53ece0a7fa (diff)
downloadsonarqube-b9f8b710d6f7c3ae5799fbacb9e93403b3babf08.tar.gz
sonarqube-b9f8b710d6f7c3ae5799fbacb9e93403b3babf08.zip
Purge the table AUTHORS
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/purge/PurgeCommands.java5
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml4
-rw-r--r--sonar-core/src/test/java/org/sonar/core/purge/PurgeCommandsTest.java2
3 files changed, 10 insertions, 1 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/purge/PurgeCommands.java b/sonar-core/src/main/java/org/sonar/core/purge/PurgeCommands.java
index 22a841a2e3f..d6b26da3cbe 100644
--- a/sonar-core/src/main/java/org/sonar/core/purge/PurgeCommands.java
+++ b/sonar-core/src/main/java/org/sonar/core/purge/PurgeCommands.java
@@ -99,6 +99,11 @@ final class PurgeCommands {
mapper.deleteResource(resourceId);
}
session.commit();
+
+ for (Long resourceId : resourceIds) {
+ mapper.deleteAuthors(resourceId);
+ }
+ session.commit();
}
@VisibleForTesting
diff --git a/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml b/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml
index 1a58d70d02d..b7abc56a6a0 100644
--- a/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/purge/PurgeMapper.xml
@@ -176,6 +176,10 @@
delete from action_plans where project_id=#{id}
</delete>
+ <delete id="deleteAuthors" parameterType="long">
+ delete from authors where person_id=#{id}
+ </delete>
+
<update id="setSnapshotIsLastToFalse" parameterType="long">
update snapshots set islast=${_false} where project_id=#{id}
</update>
diff --git a/sonar-core/src/test/java/org/sonar/core/purge/PurgeCommandsTest.java b/sonar-core/src/test/java/org/sonar/core/purge/PurgeCommandsTest.java
index d4411bfa8be..4ffe7272474 100644
--- a/sonar-core/src/test/java/org/sonar/core/purge/PurgeCommandsTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/purge/PurgeCommandsTest.java
@@ -83,7 +83,7 @@ public class PurgeCommandsTest extends DaoTestCase {
} finally {
MyBatis.closeQuietly(session);
}
- assertEmptyTables("projects", "snapshots", "events", "reviews", "review_comments");
+ assertEmptyTables("projects", "snapshots", "events", "reviews", "review_comments", "authors");
}
}