From b309ce1704e490af7daef2a0d0ab1bbba8c930b8 Mon Sep 17 00:00:00 2001 From: Duarte Meneses Date: Mon, 31 Oct 2022 15:58:49 -0500 Subject: SONAR-17547 When creating a project, error is returned if key already exists in multiple branches --- .../resources/org/sonar/db/component/ComponentMapper.xml | 1 + .../test/java/org/sonar/db/component/ComponentDaoTest.java | 12 ++++++++++++ 2 files changed, 13 insertions(+) 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 5f67411da9d..6fd35693df0 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 @@ -39,6 +39,7 @@ FROM components p where lower(p.kee)=lower(#{key,jdbcType=VARCHAR}) + and p.main_branch_project_uuid is null