From: Julien Lancelot Date: Tue, 19 Sep 2017 09:28:37 +0000 (+0200) Subject: SONAR-9616 Correctly delete branches when deleting organization X-Git-Tag: 6.6-RC1~270 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=312fa3ba13f096aa08aca799d13b9335eda059a7;p=sonarqube.git SONAR-9616 Correctly delete branches when deleting organization --- diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDao.java b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDao.java index b8df226eb4e..e3b3b556c6b 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDao.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/component/ComponentDao.java @@ -249,6 +249,8 @@ public class ComponentDao implements Dao { /** * Select all root components (projects and views), including disabled ones, for a given organization. + * + * Branches are not returned */ public List selectAllRootsByOrganization(DbSession dbSession, String organizationUuid) { return mapper(dbSession).selectAllRootsByOrganization(organizationUuid); diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ComponentMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ComponentMapper.xml index dec681a80fd..feaa6661866 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ComponentMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/component/ComponentMapper.xml @@ -243,6 +243,7 @@ p.scope='PRJ' and (p.qualifier='TRK' or p.qualifier='VW' or p.qualifier='APP') and p.organization_uuid = #{organizationUuid,jdbcType=VARCHAR} + and p.main_branch_project_uuid IS NULL