diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-11-10 12:02:26 +0100 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-11-14 12:18:51 +0100 |
commit | feda9c29f81ed7a1628afb9fbb5e47824f2f0c35 (patch) | |
tree | 3ed1a95241090a13c021ef150d650928cca9c504 /sonar-db/src/main/java/org/sonar | |
parent | 34cdbe891e9b45f42d35ee6deb2776cdfe50b431 (diff) | |
download | sonarqube-feda9c29f81ed7a1628afb9fbb5e47824f2f0c35.tar.gz sonarqube-feda9c29f81ed7a1628afb9fbb5e47824f2f0c35.zip |
SONAR-8353 purge webhook deliveries when deleting project
Diffstat (limited to 'sonar-db/src/main/java/org/sonar')
3 files changed, 10 insertions, 0 deletions
diff --git a/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java b/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java index f77dfc2cdc8..4ce1529558e 100644 --- a/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java +++ b/sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java @@ -210,4 +210,11 @@ class PurgeCommands { session.commit(); profiler.stop(); } + + public void deleteWebhookDeliveries(String rootUuid) { + profiler.start("deleteWebhookDeliveries (webhook_deliveries)"); + purgeMapper.deleteWebhookDeliveriesByProjectUuid(rootUuid); + session.commit(); + profiler.stop(); + } } diff --git a/sonar-db/src/main/java/org/sonar/db/purge/PurgeDao.java b/sonar-db/src/main/java/org/sonar/db/purge/PurgeDao.java index aba3ff7e704..9621fdbf1f7 100644 --- a/sonar-db/src/main/java/org/sonar/db/purge/PurgeDao.java +++ b/sonar-db/src/main/java/org/sonar/db/purge/PurgeDao.java @@ -162,6 +162,7 @@ public class PurgeDao implements Dao { commands.deleteComponents(childrenIds); commands.deleteFileSources(rootUuid); commands.deleteCeActivity(rootUuid); + commands.deleteWebhookDeliveries(rootUuid); } public void deleteAnalyses(DbSession session, PurgeProfiler profiler, List<IdUuidPair> analysisIdUuids) { diff --git a/sonar-db/src/main/java/org/sonar/db/purge/PurgeMapper.java b/sonar-db/src/main/java/org/sonar/db/purge/PurgeMapper.java index 91cb547e29f..c5662ec929d 100644 --- a/sonar-db/src/main/java/org/sonar/db/purge/PurgeMapper.java +++ b/sonar-db/src/main/java/org/sonar/db/purge/PurgeMapper.java @@ -89,4 +89,6 @@ public interface PurgeMapper { void deleteFileSourcesByUuid(@Param("fileUuids") List<String> fileUuids); void deleteCeActivityByProjectUuid(String projectUuid); + + void deleteWebhookDeliveriesByProjectUuid(@Param("projectUuid") String projectUuid); } |