From 099e2173f49793d0814c034300983e6a030a1116 Mon Sep 17 00:00:00 2001 From: Jacek Date: Tue, 6 Aug 2019 15:57:25 +0200 Subject: [PATCH] SONAR-12364 - IT fixes, add uniq new code period table constraint --- .../org/sonar/db/newcodeperiod/NewCodePeriodMapper.xml | 4 ++++ .../migration/version/v80/CreateNewCodePeriodTable.java | 9 +++++++++ .../version/v80/CreateNewCodePeriodTableTest.java | 1 + .../version/v00/PopulateInitialSchemaTest/v79.sql | 2 ++ .../server/projectanalysis/ws/SetBaselineAction.java | 2 +- .../server/projectanalysis/ws/SetBaselineActionTest.java | 4 ++-- 6 files changed, 19 insertions(+), 3 deletions(-) diff --git a/server/sonar-db-dao/src/main/resources/org/sonar/db/newcodeperiod/NewCodePeriodMapper.xml b/server/sonar-db-dao/src/main/resources/org/sonar/db/newcodeperiod/NewCodePeriodMapper.xml index fbd85860878..17371e37d22 100644 --- a/server/sonar-db-dao/src/main/resources/org/sonar/db/newcodeperiod/NewCodePeriodMapper.xml +++ b/server/sonar-db-dao/src/main/resources/org/sonar/db/newcodeperiod/NewCodePeriodMapper.xml @@ -52,6 +52,10 @@ updated_at=#{updatedAt, jdbcType=TIMESTAMP} WHERE uuid=#{uuid, jdbcType=VARCHAR} + OR + (project_uuid=#{projectUuid, jdbcType=VARCHAR} + AND + branch_uuid=#{branchUuid, jdbcType=VARCHAR})