aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-db/src/main/java/org/sonar
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2016-11-10 12:02:26 +0100
committerSimon Brandhof <simon.brandhof@sonarsource.com>2016-11-14 12:18:51 +0100
commitfeda9c29f81ed7a1628afb9fbb5e47824f2f0c35 (patch)
tree3ed1a95241090a13c021ef150d650928cca9c504 /sonar-db/src/main/java/org/sonar
parent34cdbe891e9b45f42d35ee6deb2776cdfe50b431 (diff)
downloadsonarqube-feda9c29f81ed7a1628afb9fbb5e47824f2f0c35.tar.gz
sonarqube-feda9c29f81ed7a1628afb9fbb5e47824f2f0c35.zip
SONAR-8353 purge webhook deliveries when deleting project
Diffstat (limited to 'sonar-db/src/main/java/org/sonar')
-rw-r--r--sonar-db/src/main/java/org/sonar/db/purge/PurgeCommands.java7
-rw-r--r--sonar-db/src/main/java/org/sonar/db/purge/PurgeDao.java1
-rw-r--r--sonar-db/src/main/java/org/sonar/db/purge/PurgeMapper.java2
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);
}