From 0031271ee4f383ee0e19d6f01944cbd8f29e58c9 Mon Sep 17 00:00:00 2001 From: Jacek Date: Mon, 8 Nov 2021 12:15:28 +0100 Subject: [PATCH] Make new portfolio queries oracle compliant --- .../sonar/db/portfolio/PortfolioMapper.xml | 64 +++++++++++++++---- 1 file changed, 52 insertions(+), 12 deletions(-) diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/portfolio/PortfolioMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/portfolio/PortfolioMapper.xml index 85db3d297fa..64eff0fb448 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/portfolio/PortfolioMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/portfolio/PortfolioMapper.xml @@ -294,7 +294,7 @@ AND source.root_uuid = #{rootUuid,jdbcType=VARCHAR}) - + DELETE FROM portfolio_proj_branches WHERE portfolio_project_uuid in (select uuid FROM portfolio_projects WHERE portfolio_uuid = #{uuid,jdbcType=VARCHAR}); @@ -302,6 +302,16 @@ WHERE portfolio_uuid = #{uuid,jdbcType=VARCHAR}; DELETE FROM portfolios WHERE uuid = #{uuid,jdbcType=VARCHAR}; + + + + + + + + BEGIN + + END; @@ -319,9 +329,19 @@ DELETE FROM portfolio_references - + DELETE FROM portfolio_projects; - DELETE FROM portfolio_proj_branches + DELETE FROM portfolio_proj_branches; + + + + + + + + BEGIN + + END; @@ -352,26 +372,46 @@ WHERE reference_uuid = #{referenceUuid,jdbcType=VARCHAR} - + DELETE FROM portfolio_proj_branches WHERE portfolio_project_uuid in - (SELECT uuid FROM portfolio_projects - WHERE portfolio_uuid = #{portfolioUuid,jdbcType=VARCHAR}); + (SELECT uuid FROM portfolio_projects + WHERE portfolio_uuid = #{portfolioUuid,jdbcType=VARCHAR}); DELETE FROM portfolio_projects - WHERE portfolio_uuid = #{portfolioUuid,jdbcType=VARCHAR} + WHERE portfolio_uuid = #{portfolioUuid,jdbcType=VARCHAR}; + + + + - + + BEGIN + + END; + + + DELETE FROM portfolio_proj_branches WHERE portfolio_project_uuid = - (SELECT uuid FROM portfolio_projects - WHERE portfolio_uuid = #{portfolioUuid,jdbcType=VARCHAR} - AND project_uuid = #{projectUuid,jdbcType=VARCHAR}); + (SELECT uuid FROM portfolio_projects + WHERE portfolio_uuid = #{portfolioUuid,jdbcType=VARCHAR} + AND project_uuid = #{projectUuid,jdbcType=VARCHAR}); DELETE FROM portfolio_projects WHERE portfolio_uuid = #{portfolioUuid,jdbcType=VARCHAR} - AND project_uuid = #{projectUuid,jdbcType=VARCHAR} + AND project_uuid = #{projectUuid,jdbcType=VARCHAR}; + + + + + + + + BEGIN + + END; -- 2.39.5