diff options
author | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-06-29 07:22:53 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@sonarsource.com> | 2016-06-29 07:22:53 +0200 |
commit | 9dc5ec05a0301fb2b46b621c5de3eb5ef4752119 (patch) | |
tree | f3ede925188f6d32bb9c6cb9a36808d13c9a6169 | |
parent | 87f2df380bc31b616fa9a1b6376b0ff26ee84ccc (diff) | |
download | sonarqube-9dc5ec05a0301fb2b46b621c5de3eb5ef4752119.tar.gz sonarqube-9dc5ec05a0301fb2b46b621c5de3eb5ef4752119.zip |
Revert "SONAR-7780 table PROJECT_MEASURES should use analysis UUID"
This reverts commit 87f2df380bc31b616fa9a1b6376b0ff26ee84ccc.
52 files changed, 101 insertions, 1175 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureToMeasureDto.java b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureToMeasureDto.java index 718b3e02c87..bcee6b62bca 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureToMeasureDto.java +++ b/server/sonar-server/src/main/java/org/sonar/server/computation/measure/MeasureToMeasureDto.java @@ -22,7 +22,6 @@ package org.sonar.server.computation.measure; import javax.annotation.CheckForNull; import javax.annotation.Nonnull; import org.sonar.db.measure.MeasureDto; -import org.sonar.server.computation.analysis.AnalysisMetadataHolder; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.DbIdsRepository; import org.sonar.server.computation.component.Developer; @@ -31,11 +30,9 @@ import org.sonar.server.computation.metric.Metric; public class MeasureToMeasureDto { private final DbIdsRepository dbIdsRepository; - private final AnalysisMetadataHolder analysisMetadataHolder; - public MeasureToMeasureDto(DbIdsRepository dbIdsRepository, AnalysisMetadataHolder analysisMetadataHolder) { + public MeasureToMeasureDto(DbIdsRepository dbIdsRepository) { this.dbIdsRepository = dbIdsRepository; - this.analysisMetadataHolder = analysisMetadataHolder; } @Nonnull @@ -43,7 +40,6 @@ public class MeasureToMeasureDto { MeasureDto out = new MeasureDto(); out.setMetricId(metric.getId()); out.setComponentUuid(component.getUuid()); - out.setAnalysisUuid(analysisMetadataHolder.getUuid()); out.setSnapshotId(dbIdsRepository.getSnapshotId(component)); if (measure.hasVariations()) { setVariations(out, measure.getVariations()); diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java index 59e55e15855..42530009c89 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureRepositoryImplTest.java @@ -71,7 +71,6 @@ public class MeasureRepositoryImplTest { @Rule public BatchReportReaderRule reportReader = new BatchReportReaderRule(); - private static final String AN_ANALYSIS_UUID = "a1"; private static final String FILE_COMPONENT_KEY = "file cpt key"; private static final ReportComponent FILE_COMPONENT = ReportComponent.builder(Component.Type.FILE, 1).setKey(FILE_COMPONENT_KEY).build(); private static final ReportComponent OTHER_COMPONENT = ReportComponent.builder(Component.Type.FILE, 2).setKey("some other key").build(); @@ -421,7 +420,6 @@ public class MeasureRepositoryImplTest { return new MeasureDto() .setComponentUuid(componentUuid) .setSnapshotId(snapshotId) - .setAnalysisUuid(AN_ANALYSIS_UUID) .setData(SOME_DATA) .setMetricId(metricId); } diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureToMeasureDtoTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureToMeasureDtoTest.java index b6c9a5d852e..ea336c32f8f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureToMeasureDtoTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/measure/MeasureToMeasureDtoTest.java @@ -27,7 +27,6 @@ import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.sonar.db.measure.MeasureDto; -import org.sonar.server.computation.analysis.MutableAnalysisMetadataHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.Developer; import org.sonar.server.computation.component.DumbDeveloper; @@ -52,22 +51,18 @@ public class MeasureToMeasureDtoTest { private static final MetricImpl SOME_DOUBLE_METRIC = new MetricImpl(4, "4", "4", Metric.MetricType.FLOAT); private static final MetricImpl SOME_STRING_METRIC = new MetricImpl(5, "5", "5", Metric.MetricType.STRING); private static final MetricImpl SOME_LEVEL_METRIC = new MetricImpl(6, "6", "6", Metric.MetricType.LEVEL); - private static final String ANALYSIS_UUID = "a1"; - private static final Component SOME_COMPONENT = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("uuid_1").build(); - @Rule - public MutableDbIdsRepositoryRule dbIdsRepository = MutableDbIdsRepositoryRule.create(SOME_COMPONENT); + static final Component SOME_COMPONENT = ReportComponent.builder(Component.Type.PROJECT, 1).setUuid("uuid_1").build(); @Rule - public MutableAnalysisMetadataHolderRule analysisMetadataHolder = new MutableAnalysisMetadataHolderRule(); + public MutableDbIdsRepositoryRule dbIdsRepository = MutableDbIdsRepositoryRule.create(SOME_COMPONENT); - MeasureToMeasureDto underTest = new MeasureToMeasureDto(dbIdsRepository, analysisMetadataHolder); + MeasureToMeasureDto underTest = new MeasureToMeasureDto(dbIdsRepository); @Before public void setUp() throws Exception { dbIdsRepository.setComponentId(SOME_COMPONENT, SOME_COMPONENT_ID); dbIdsRepository.setSnapshotId(SOME_COMPONENT, SOME_SNAPSHOT_ID); - analysisMetadataHolder.setUuid(ANALYSIS_UUID); } @Test(expected = NullPointerException.class) diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java index 8c2d769859f..2a823ba206f 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/PersistMeasuresStepTest.java @@ -30,7 +30,6 @@ import org.sonar.db.DbClient; import org.sonar.db.DbTester; import org.sonar.db.component.ComponentDto; import org.sonar.db.rule.RuleDto; -import org.sonar.server.computation.analysis.MutableAnalysisMetadataHolderRule; import org.sonar.server.computation.batch.TreeRootHolderRule; import org.sonar.server.computation.component.Component; import org.sonar.server.computation.component.Developer; @@ -81,7 +80,6 @@ public class PersistMeasuresStepTest extends BaseStepTest { private static final long INTERMEDIATE_1_SNAPSHOT_ID = 4L; private static final long INTERMEDIATE_2_SNAPSHOT_ID = 5L; private static final long LEAF_SNAPSHOT_ID = 6L; - private static final String ANALYSIS_UUID = "a1"; @Rule public DbTester dbTester = DbTester.create(System2.INSTANCE); @@ -94,9 +92,6 @@ public class PersistMeasuresStepTest extends BaseStepTest { @Rule public MutableDbIdsRepositoryRule dbIdsRepository = MutableDbIdsRepositoryRule.create(treeRootHolder); - @Rule - public MutableAnalysisMetadataHolderRule analysisMetadataHolder = new MutableAnalysisMetadataHolderRule(); - DbClient dbClient = dbTester.getDbClient(); RuleDto rule; ComponentDto rootDto; @@ -108,8 +103,7 @@ public class PersistMeasuresStepTest extends BaseStepTest { @Before public void setUp() { - underTest = new PersistMeasuresStep(dbClient, metricRepository, new MeasureToMeasureDto(dbIdsRepository, analysisMetadataHolder), treeRootHolder, measureRepository); - analysisMetadataHolder.setUuid(ANALYSIS_UUID); + underTest = new PersistMeasuresStep(dbClient, metricRepository, new MeasureToMeasureDto(dbIdsRepository), treeRootHolder, measureRepository); } private void setupReportComponents() { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java index 9966397b101..a30a26cd2ac 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportComputeMeasureVariationsStepTest.java @@ -51,16 +51,16 @@ import static org.sonar.server.computation.measure.Measure.newMeasureBuilder; public class ReportComputeMeasureVariationsStepTest { - private static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT); - private static final Metric DEBT_METRIC = new MetricImpl(2, "sqale_index", "sqale_index", Metric.MetricType.WORK_DUR); - private static final Metric FILE_COMPLEXITY_METRIC = new MetricImpl(3, "file_complexity", "file_complexity", Metric.MetricType.FLOAT); - private static final Metric BUILD_BREAKER_METRIC = new MetricImpl(4, "build_breaker", "build_breaker", Metric.MetricType.BOOL); - private static final Metric NEW_DEBT = new MetricImpl(5, "new_debt", "new_debt", Metric.MetricType.WORK_DUR); - private static final String ANALYSIS_UUID = "a1"; - private static final ComponentDto PROJECT_DTO = ComponentTesting.newProjectDto(); - private static final int PROJECT_REF = 1; - private static final Component PROJECT = ReportComponent.builder(Component.Type.PROJECT, PROJECT_REF).setUuid(PROJECT_DTO.uuid()).build(); + static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT); + static final Metric DEBT_METRIC = new MetricImpl(2, "sqale_index", "sqale_index", Metric.MetricType.WORK_DUR); + static final Metric FILE_COMPLEXITY_METRIC = new MetricImpl(3, "file_complexity", "file_complexity", Metric.MetricType.FLOAT); + static final Metric BUILD_BREAKER_METRIC = new MetricImpl(4, "build_breaker", "build_breaker", Metric.MetricType.BOOL); + static final Metric NEW_DEBT = new MetricImpl(5, "new_debt", "new_debt", Metric.MetricType.WORK_DUR); + static final ComponentDto PROJECT_DTO = ComponentTesting.newProjectDto(); + + static final int PROJECT_REF = 1; + static final Component PROJECT = ReportComponent.builder(Component.Type.PROJECT, PROJECT_REF).setUuid(PROJECT_DTO.uuid()).build(); @Rule public DbTester dbTester = DbTester.create(System2.INSTANCE); @@ -319,12 +319,7 @@ public class ReportComputeMeasureVariationsStepTest { } private static MeasureDto newMeasureDto(int metricId, String componentUuid, long snapshotId, double value) { - return new MeasureDto() - .setMetricId(metricId) - .setComponentUuid(componentUuid) - .setSnapshotId(snapshotId) - .setAnalysisUuid(ANALYSIS_UUID) - .setValue(value); + return new MeasureDto().setMetricId(metricId).setComponentUuid(componentUuid).setSnapshotId(snapshotId).setValue(value); } private static Period newPeriod(int index, SnapshotDto snapshotDto) { diff --git a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java index f014d72529b..4f5cef4e49c 100644 --- a/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java +++ b/server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsComputeMeasureVariationsStepTest.java @@ -49,13 +49,14 @@ import static org.sonar.db.component.SnapshotTesting.newSnapshotForView; public class ViewsComputeMeasureVariationsStepTest { - private static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT); - private static final Metric DEBT_METRIC = new MetricImpl(2, "sqale_index", "sqale_index", Metric.MetricType.WORK_DUR); - private static final Metric FILE_COMPLEXITY_METRIC = new MetricImpl(3, "file_complexity", "file_complexity", Metric.MetricType.FLOAT); - private static final Metric BUILD_BREAKER_METRIC = new MetricImpl(4, "build_breaker", "build_breaker", Metric.MetricType.BOOL); - private static final ComponentDto VIEW_DTO = ComponentTesting.newView(); - private static final Component VIEW = ViewsComponent.builder(Component.Type.VIEW, 1).setUuid(VIEW_DTO.uuid()).build(); - private static final String ANALYSIS_UUID = "a1"; + static final Metric ISSUES_METRIC = new MetricImpl(1, "violations", "violations", Metric.MetricType.INT); + static final Metric DEBT_METRIC = new MetricImpl(2, "sqale_index", "sqale_index", Metric.MetricType.WORK_DUR); + static final Metric FILE_COMPLEXITY_METRIC = new MetricImpl(3, "file_complexity", "file_complexity", Metric.MetricType.FLOAT); + static final Metric BUILD_BREAKER_METRIC = new MetricImpl(4, "build_breaker", "build_breaker", Metric.MetricType.BOOL); + + static final ComponentDto VIEW_DTO = ComponentTesting.newView(); + + static final Component VIEW = ViewsComponent.builder(Component.Type.VIEW, 1).setUuid(VIEW_DTO.uuid()).build(); @Rule public DbTester dbTester = DbTester.create(System2.INSTANCE); @@ -222,12 +223,7 @@ public class ViewsComputeMeasureVariationsStepTest { } private static MeasureDto newMeasureDto(int metricId, String componentUuid, long snapshotId, double value) { - return new MeasureDto() - .setMetricId(metricId) - .setComponentUuid(componentUuid) - .setSnapshotId(snapshotId) - .setAnalysisUuid(ANALYSIS_UUID) - .setValue(value); + return new MeasureDto().setMetricId(metricId).setComponentUuid(componentUuid).setSnapshotId(snapshotId).setValue(value); } private static Period newPeriod(int index, SnapshotDto snapshotDto) { diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml index 9a01b234b33..289d321734a 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml @@ -91,7 +91,6 @@ VALUE="60" METRIC_ID="1" SNAPSHOT_ID="1000" - analysis_uuid="u1000" text_value="[null]" project_id="[null]" person_id="[null]"/> @@ -100,7 +99,6 @@ VALUE="80" METRIC_ID="2" SNAPSHOT_ID="1000" - analysis_uuid="u1000" text_value="[null]" project_id="[null]" person_id="[null]"/> @@ -110,7 +108,6 @@ VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1001" - analysis_uuid="u1000" text_value="[null]" project_id="[null]" person_id="[null]"/> @@ -119,7 +116,6 @@ VALUE="70" METRIC_ID="2" SNAPSHOT_ID="1001" - analysis_uuid="u1000" text_value="[null]" project_id="[null]" person_id="[null]"/> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml index f788fbd156e..68809ddb260 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file-result.xml @@ -1,29 +1,11 @@ <dataset> - <project_measures id="1" - snapshot_id="1000" - analysis_uuid="u1000" - metric_id="10" - value="[null]" + <project_measures id="1" snapshot_id="1000" metric_id="10" value="[null]" text_value="<duplications><g><b s="1" l="5" r="PROJECT_KEY:file"/><b s="6" l="10" r="PROJECT_KEY:file">" - measure_data="[null]" - variation_value_1="[null]" - variation_value_2="[null]" - variation_value_3="[null]" - variation_value_4="[null]" - variation_value_5="[null]"/> + measure_data="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" /> - <project_measures id="2" - snapshot_id="1000" - analysis_uuid="u1000" - metric_id="10" - value="[null]" + <project_measures id="2" snapshot_id="1000" metric_id="10" value="[null]" text_value="<duplications><g><b s="1" l="5" r="PROJECT_KEY:file"/><b s="6" l="10" r="PROJECT_KEY:file">" - measure_data="[null]" - variation_value_1="[null]" - variation_value_2="[null]" - variation_value_3="[null]" - variation_value_4="[null]" - variation_value_5="[null]"/> + measure_data="[null]" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" /> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file.xml index 0b498bd98ff..53ff5efd294 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistDuplicationMeasuresStepTest/persist_duplication_on_same_file.xml @@ -1,17 +1,6 @@ <dataset> - <metrics id="1" - name="duplications_data" - val_type="DATA" - description="Duplications details" - short_name="Duplications details" - domain="Duplication" - qualitative="[false]" - enabled="[true]" - worst_value="[null]" - optimized_best_value="[null]" - best_value="[null]" - direction="0" - hidden="[false]"/> + <metrics id="1" name="duplications_data" val_type="DATA" description="Duplications details" short_name="Duplications details" domain="Duplication" + qualitative="[false]" enabled="[true]" worst_value="[null]" optimized_best_value="[null]" best_value="[null]" direction="0" hidden="[false]"/> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml index 3006765aa14..ae4934573a6 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-index-result.xml @@ -1,18 +1,6 @@ <dataset> - <project_measures snapshot_id="1000" - analysis_uuid="u1000" - metric_id="10" - value="6.0" - project_id="[null]" - text_value="[null]" - measure_data="[null]" - variation_value_1="[null]" - variation_value_2="[null]" - variation_value_3="[null]" - variation_value_4="[null]" - variation_value_5="[null]" - alert_status="[null]" - alert_text="[null]" - description="[null]" - person_id="[null]"/> + <project_measures snapshot_id="1000" metric_id="10" value="6.0" project_id="[null]" text_value="[null]" + measure_data="[null]" variation_value_1="[null]" variation_value_2="[null]" + variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" + alert_status="[null]" alert_text="[null]" description="[null]" person_id="[null]"/> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml index 1cacaf4f14d..b6a2431d6e8 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/computation/step/PersistNumberOfDaysSinceLastCommitStepTest/insert-from-report-result.xml @@ -1,18 +1,6 @@ <dataset> - <project_measures snapshot_id="1000" - analysis_uuid="u1000" - metric_id="10" - value="3.0" - project_id="[null]" - text_value="[null]" - measure_data="[null]" - variation_value_1="[null]" - variation_value_2="[null]" - variation_value_3="[null]" - variation_value_4="[null]" - variation_value_5="[null]" - alert_status="[null]" - alert_text="[null]" - description="[null]" - person_id="[null]"/> + <project_measures snapshot_id="1000" metric_id="10" value="3.0" project_id="[null]" text_value="[null]" + measure_data="[null]" variation_value_1="[null]" variation_value_2="[null]" + variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]" + alert_status="[null]" alert_text="[null]" description="[null]" person_id="[null]"/> </dataset> diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml index bf07feecd84..87064ba708a 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml @@ -66,7 +66,6 @@ metric_id="1" value="500" snapshot_id="101" - analysis_uuid="u101" person_id="[null]" variation_value_1="[null]" variation_value_2="[null]" @@ -84,7 +83,6 @@ metric_id="1" value="300" snapshot_id="101" - analysis_uuid="u101" person_id="30000" variation_value_1="[null]" variation_value_2="[null]" @@ -101,7 +99,6 @@ metric_id="1" value="200" snapshot_id="101" - analysis_uuid="u101" person_id="40000" variation_value_1="[null]" variation_value_2="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml index 0634b49b664..ea433b44e9d 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml @@ -66,7 +66,6 @@ metric_id="1" value="500" snapshot_id="101" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml index 2c8e4c9b202..1458d4aa9f9 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml @@ -258,7 +258,6 @@ metric_id="1" value="510" snapshot_id="101" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -274,7 +273,6 @@ metric_id="1" value="510" snapshot_id="102" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -290,7 +288,6 @@ metric_id="1" value="500" snapshot_id="103" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -306,7 +303,6 @@ metric_id="1" value="10" snapshot_id="104" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -323,7 +319,6 @@ metric_id="2" value="[null]" snapshot_id="101" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -340,7 +335,6 @@ metric_id="3" value="12.3" snapshot_id="101" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -406,7 +400,6 @@ metric_id="1" value="5000" snapshot_id="110" - analysis_uuid="u110" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -422,7 +415,6 @@ metric_id="2" value="[null]" snapshot_id="110" - analysis_uuid="u110" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" diff --git a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml index 9b1af0fa97d..ce6f4f3c9cb 100644 --- a/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml +++ b/server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml @@ -68,7 +68,6 @@ metric_id="5" value="510" snapshot_id="101" - analysis_uuid="u101" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -133,7 +132,6 @@ metric_id="5" value="5000" snapshot_id="110" - analysis_uuid="u110" url="[null]" variation_value_1="[null]" variation_value_2="[null]" @@ -199,7 +197,6 @@ metric_id="5" value="5000" snapshot_id="120" - analysis_uuid="u120" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1258_add_analysis_uuid_column_to_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1258_add_analysis_uuid_column_to_measures.rb deleted file mode 100644 index 20544694def..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1258_add_analysis_uuid_column_to_measures.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -# -# SonarQube 6.0 -# -class AddAnalysisUuidColumnToMeasures < ActiveRecord::Migration - - def self.up - execute_java_migration('org.sonar.db.version.v60.AddAnalysisUuidColumnToMeasures') - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1259_populate_analysis_uuid_on_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1259_populate_analysis_uuid_on_measures.rb deleted file mode 100644 index 8e4858914f6..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1259_populate_analysis_uuid_on_measures.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -# -# SonarQube 6.0 -# -class PopulateAnalysisUuidOnMeasures < ActiveRecord::Migration - - def self.up - execute_java_migration('org.sonar.db.version.v60.PopulateAnalysisUuidOnMeasures') - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1260_clean_measures_with_null_analysis_uuid.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1260_clean_measures_with_null_analysis_uuid.rb deleted file mode 100644 index 7cfe63afcb9..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1260_clean_measures_with_null_analysis_uuid.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -# -# SonarQube 6.0 -# -class CleanMeasuresWithNullAnalysisUuid < ActiveRecord::Migration - - def self.up - execute_java_migration('org.sonar.db.version.v60.CleanMeasuresWithNullAnalysisUuid') - end -end diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1261_make_analysis_uuid_not_null_on_measures.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1261_make_analysis_uuid_not_null_on_measures.rb deleted file mode 100644 index 2faf467f2d3..00000000000 --- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1261_make_analysis_uuid_not_null_on_measures.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# SonarQube, open source software quality management tool. -# Copyright (C) 2008-2014 SonarSource -# mailto:contact AT sonarsource DOT com -# -# SonarQube is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 3 of the License, or (at your option) any later version. -# -# SonarQube is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program; if not, write to the Free Software Foundation, -# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# - -# -# SonarQube 6.0 -# -class MakeAnalysisUuidNotNullOnMeasures < ActiveRecord::Migration - - def self.up - execute_java_migration('org.sonar.db.version.v60.MakeAnalysisUuidNotNullOnMeasures') - end -end diff --git a/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java b/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java index 7eeb2c77eec..b8ffe2469cb 100644 --- a/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java +++ b/sonar-db/src/main/java/org/sonar/db/measure/MeasureDto.java @@ -42,7 +42,6 @@ public class MeasureDto { private String description; private String componentUuid; private Long snapshotId; - private String analysisUuid; private Integer metricId; private Long developerId; @@ -189,15 +188,6 @@ public class MeasureDto { return this; } - public String getAnalysisUuid() { - return analysisUuid; - } - - public MeasureDto setAnalysisUuid(String s) { - this.analysisUuid = s; - return this; - } - /** * @deprecated in 5.5. Does nothing. Kept for compatibility with developer cockpit plugin, version 1.10 */ @@ -250,7 +240,6 @@ public class MeasureDto { .add("description", description) .add("componentUuid", componentUuid) .add("snapshotId", snapshotId) - .add("analysisUuid", analysisUuid) .add("metricId", metricId) .add("developerId", developerId) .add("metricKey", metricKey) diff --git a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java index 1ab5f63e537..09e6fd5afd8 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java +++ b/sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java @@ -30,7 +30,7 @@ import org.sonar.db.MyBatis; public class DatabaseVersion { - public static final int LAST_VERSION = 1_261; + public static final int LAST_VERSION = 1_257; /** * The minimum supported version which can be upgraded. Lower diff --git a/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java b/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java index f3a9f918812..5dd6b7e55e7 100644 --- a/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java +++ b/sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java @@ -86,7 +86,6 @@ import org.sonar.db.version.v56.FixTypeOfRuleTypeOnMysql; import org.sonar.db.version.v60.AddAnalysisUuidColumnToCeActivity; import org.sonar.db.version.v60.AddAnalysisUuidColumnToDuplicationsIndex; import org.sonar.db.version.v60.AddAnalysisUuidColumnToEvents; -import org.sonar.db.version.v60.AddAnalysisUuidColumnToMeasures; import org.sonar.db.version.v60.AddComponentUuidColumnToDuplicationsIndex; import org.sonar.db.version.v60.AddComponentUuidColumnToMeasures; import org.sonar.db.version.v60.AddComponentUuidColumnsToSnapshots; @@ -100,7 +99,6 @@ import org.sonar.db.version.v60.CleanEventsWithoutSnapshotId; import org.sonar.db.version.v60.CleanOrphanRowsInProjects; import org.sonar.db.version.v60.CleanOrphanRowsInResourceIndex; import org.sonar.db.version.v60.CleanOrphanRowsInSnapshots; -import org.sonar.db.version.v60.CleanMeasuresWithNullAnalysisUuid; import org.sonar.db.version.v60.DeleteOrphanDuplicationsIndexRowsWithoutAnalysis; import org.sonar.db.version.v60.DeleteOrphanDuplicationsIndexRowsWithoutComponent; import org.sonar.db.version.v60.DeleteOrphanMeasuresWithoutComponent; @@ -115,7 +113,6 @@ import org.sonar.db.version.v60.DropSnapshotIdColumnsFromDuplicationsIndex; import org.sonar.db.version.v60.DropUnusedMeasuresColumns; import org.sonar.db.version.v60.MakeAnalysisUuidNotNullOnDuplicationsIndex; import org.sonar.db.version.v60.MakeAnalysisUuidNotNullOnEvents; -import org.sonar.db.version.v60.MakeAnalysisUuidNotNullOnMeasures; import org.sonar.db.version.v60.MakeComponentUuidColumnsNotNullOnSnapshots; import org.sonar.db.version.v60.MakeComponentUuidNotNullOnDuplicationsIndex; import org.sonar.db.version.v60.MakeComponentUuidNotNullOnMeasures; @@ -126,7 +123,6 @@ import org.sonar.db.version.v60.MakeUuidPathColumnNotNullOnProjects; import org.sonar.db.version.v60.PopulateAnalysisUuidColumnOnCeActivity; import org.sonar.db.version.v60.PopulateAnalysisUuidOfDuplicationsIndex; import org.sonar.db.version.v60.PopulateAnalysisUuidOnEvents; -import org.sonar.db.version.v60.PopulateAnalysisUuidOnMeasures; import org.sonar.db.version.v60.PopulateComponentUuidColumnsOfSnapshots; import org.sonar.db.version.v60.PopulateComponentUuidOfDuplicationsIndex; import org.sonar.db.version.v60.PopulateComponentUuidOfMeasures; @@ -279,13 +275,6 @@ public class MigrationStepModule extends Module { // PROJECTS.UUID_PATH AddUuidPathColumnToProjects.class, PopulateUuidPathColumnOnProjects.class, - MakeUuidPathColumnNotNullOnProjects.class, - - // PROJECT_MEASURES.ANALYSIS_UUID - AddAnalysisUuidColumnToMeasures.class, - PopulateAnalysisUuidOnMeasures.class, - CleanMeasuresWithNullAnalysisUuid.class, - MakeAnalysisUuidNotNullOnMeasures.class - ); + MakeUuidPathColumnNotNullOnProjects.class); } } diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasures.java b/sonar-db/src/main/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasures.java deleted file mode 100644 index f78c80181c9..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasures.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import org.sonar.db.Database; -import org.sonar.db.version.AddColumnsBuilder; -import org.sonar.db.version.DdlChange; - -import static org.sonar.db.version.VarcharColumnDef.UUID_VARCHAR_SIZE; -import static org.sonar.db.version.VarcharColumnDef.newVarcharColumnDefBuilder; - -public class AddAnalysisUuidColumnToMeasures extends DdlChange { - - private static final String TABLE_MEASURES = "project_measures"; - - public AddAnalysisUuidColumnToMeasures(Database db) { - super(db); - } - - @Override - public void execute(Context context) throws SQLException { - context.execute(new AddColumnsBuilder(getDatabase().getDialect(), TABLE_MEASURES) - .addColumn(newVarcharColumnDefBuilder().setColumnName("analysis_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(true).build()) - .build()); - } - -} diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuid.java b/sonar-db/src/main/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuid.java deleted file mode 100644 index 2def559c897..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuid.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import org.sonar.db.Database; -import org.sonar.db.version.BaseDataChange; -import org.sonar.db.version.MassUpdate; - -public class CleanMeasuresWithNullAnalysisUuid extends BaseDataChange { - - public CleanMeasuresWithNullAnalysisUuid(Database db) { - super(db); - } - - @Override - public void execute(Context context) throws SQLException { - MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select id from project_measures where analysis_uuid is null"); - massUpdate.update("delete from project_measures where id=?"); - massUpdate.rowPluralName("measures"); - massUpdate.execute((row, update) -> { - update.setLong(1, row.getLong(1)); - return true; - }); - } - -} diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasures.java b/sonar-db/src/main/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasures.java deleted file mode 100644 index c7c05717cca..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasures.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import org.sonar.db.Database; -import org.sonar.db.version.AlterColumnsBuilder; -import org.sonar.db.version.DdlChange; - -import static org.sonar.db.version.VarcharColumnDef.UUID_VARCHAR_SIZE; -import static org.sonar.db.version.VarcharColumnDef.newVarcharColumnDefBuilder; - -public class MakeAnalysisUuidNotNullOnMeasures extends DdlChange { - - private static final String TABLE_MEASURES = "project_measures"; - - public MakeAnalysisUuidNotNullOnMeasures(Database db) { - super(db); - } - - @Override - public void execute(Context context) throws SQLException { - context.execute(new AlterColumnsBuilder(getDatabase().getDialect(), TABLE_MEASURES) - .updateColumn(newVarcharColumnDefBuilder().setColumnName("analysis_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(false).build()) - .build()); - } - -} diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasures.java b/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasures.java deleted file mode 100644 index 8393b129fe6..00000000000 --- a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasures.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import org.sonar.db.Database; -import org.sonar.db.version.BaseDataChange; -import org.sonar.db.version.MassUpdate; -import org.sonar.db.version.Select; -import org.sonar.db.version.SqlStatement; - -public class PopulateAnalysisUuidOnMeasures extends BaseDataChange { - - public PopulateAnalysisUuidOnMeasures(Database db) { - super(db); - } - - @Override - public void execute(Context context) throws SQLException { - MassUpdate massUpdate = context.prepareMassUpdate(); - massUpdate.select("select distinct m.snapshot_id, root_snapshots.uuid " + - "from project_measures m " + - "inner join snapshots s on m.snapshot_id=s.id " + - "inner join snapshots root_snapshots on s.root_snapshot_id=root_snapshots.id " + - "where m.analysis_uuid is null"); - massUpdate.update("update project_measures set analysis_uuid=? where snapshot_id=? and analysis_uuid is null"); - massUpdate.rowPluralName("measures"); - massUpdate.execute(this::handle); - } - - private boolean handle(Select.Row row, SqlStatement update) throws SQLException { - long snapshotId = row.getLong(1); - String analysisUuid = row.getString(2); - - update.setString(1, analysisUuid); - update.setLong(2, snapshotId); - - return true; - } - -} diff --git a/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml b/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml index c98feb9fbcf..c256b0b34c7 100644 --- a/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml +++ b/sonar-db/src/main/resources/org/sonar/db/measure/MeasureMapper.xml @@ -8,7 +8,6 @@ pm.person_id as developerId, pm.component_uuid as componentUuid, pm.snapshot_id as snapshotId, - pm.analysis_uuid as analysisUuid, pm.value as value, pm.text_value as textValue, pm.alert_status as alertStatus, @@ -218,39 +217,18 @@ <insert id="insert" parameterType="Measure" useGeneratedKeys="false"> INSERT INTO project_measures ( - value, - metric_id, - component_uuid, - snapshot_id, - analysis_uuid, - text_value, - alert_status, - alert_text, - description, - person_id, - variation_value_1, - variation_value_2, - variation_value_3, - variation_value_4, - variation_value_5, - measure_data) + value, metric_id, component_uuid, snapshot_id, text_value, alert_status, alert_text, description, + person_id, variation_value_1, variation_value_2, variation_value_3, variation_value_4, + variation_value_5, measure_data) VALUES ( - #{value, jdbcType=DOUBLE}, - #{metricId, jdbcType=INTEGER}, - #{componentUuid, jdbcType=VARCHAR}, + #{value, jdbcType=DOUBLE}, #{metricId, jdbcType=INTEGER}, #{componentUuid, jdbcType=VARCHAR}, #{snapshotId, jdbcType=INTEGER}, - #{analysisUuid, jdbcType=VARCHAR}, #{textValue, jdbcType=VARCHAR}, - #{alertStatus, jdbcType=VARCHAR}, - #{alertText, jdbcType=VARCHAR}, + #{alertStatus, jdbcType=VARCHAR}, #{alertText, jdbcType=VARCHAR}, #{description, jdbcType=VARCHAR}, - #{developerId, jdbcType=INTEGER}, - #{variation1, jdbcType=DOUBLE}, - #{variation2, jdbcType=DOUBLE}, + #{developerId, jdbcType=INTEGER}, #{variation1, jdbcType=DOUBLE}, #{variation2, jdbcType=DOUBLE}, #{variation3, jdbcType=DOUBLE}, - #{variation4, jdbcType=DOUBLE}, - #{variation5, jdbcType=DOUBLE}, - #{dataValue, jdbcType=BINARY} + #{variation4, jdbcType=DOUBLE}, #{variation5, jdbcType=DOUBLE}, #{dataValue, jdbcType=BINARY} ) </insert> diff --git a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql index 0fd0413b98b..ce75f9372b6 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql +++ b/sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql @@ -464,10 +464,6 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1254'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1255'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1256'); INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1257'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1258'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1259'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1260'); -INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1261'); INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, EXTERNAL_IDENTITY, EXTERNAL_IDENTITY_PROVIDER, USER_LOCAL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT) VALUES (1, 'admin', 'Administrator', '', 'admin', 'sonarqube', true, 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482'); ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2; diff --git a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl index 12313c12212..72e3aa398c7 100644 --- a/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl +++ b/sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl @@ -199,7 +199,6 @@ CREATE TABLE "PROJECT_MEASURES" ( "VALUE" DOUBLE, "METRIC_ID" INTEGER NOT NULL, "COMPONENT_UUID" VARCHAR(50) NOT NULL, - "ANALYSIS_UUID" VARCHAR(50) NOT NULL, "SNAPSHOT_ID" INTEGER, "TEXT_VALUE" VARCHAR(4000), "ALERT_STATUS" VARCHAR(5), diff --git a/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java b/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java index ab4b11eed84..f2c43e9515c 100644 --- a/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java +++ b/sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java @@ -486,7 +486,6 @@ public class MeasureDaoTest { .setValue(value) .setComponentUuid(componentDto.uuid()) .setSnapshotId(snapshotDto.getId()) - .setAnalysisUuid("u1") .setDeveloperId(developerId); dbClient.measureDao().insert(dbSession, measureDto); dbSession.commit(); @@ -499,7 +498,6 @@ public class MeasureDaoTest { underTest.insert(dbSession, new MeasureDto() .setSnapshotId(2L) - .setAnalysisUuid("u2") .setMetricId(3) .setDeveloperId(23L) .setComponentUuid("FILE1") @@ -524,13 +522,11 @@ public class MeasureDaoTest { underTest.insert(dbSession, new MeasureDto() .setSnapshotId(2L) - .setAnalysisUuid("u2") .setMetricId(3) .setComponentUuid("COMPONENT_1") .setValue(2.0d), new MeasureDto() .setSnapshotId(3L) - .setAnalysisUuid("u2") .setMetricId(4) .setComponentUuid("COMPONENT_2") .setValue(4.0d)); diff --git a/sonar-db/src/test/java/org/sonar/db/measure/MeasureTesting.java b/sonar-db/src/test/java/org/sonar/db/measure/MeasureTesting.java index 9aff2793d0f..fcecfd476b5 100644 --- a/sonar-db/src/test/java/org/sonar/db/measure/MeasureTesting.java +++ b/sonar-db/src/test/java/org/sonar/db/measure/MeasureTesting.java @@ -37,7 +37,6 @@ public class MeasureTesting { .setMetricId(metricDto.getId()) .setMetricKey(metricDto.getKey()) .setComponentUuid(snapshot.getComponentUuid()) - .setSnapshotId(snapshot.getId()) - .setAnalysisUuid(snapshot.getUuid()); + .setSnapshotId(snapshot.getId()); } } diff --git a/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java b/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java index b72caa7bfba..a4d75a54649 100644 --- a/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java +++ b/sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java @@ -29,6 +29,6 @@ public class MigrationStepModuleTest { public void verify_count_of_added_MigrationStep_types() { ComponentContainer container = new ComponentContainer(); new MigrationStepModule().configure(container); - assertThat(container.size()).isEqualTo(117); + assertThat(container.size()).isEqualTo(113); } } diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest.java deleted file mode 100644 index 9f6f288a557..00000000000 --- a/sonar-db/src/test/java/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import java.sql.Types; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.sonar.api.utils.System2; -import org.sonar.db.DbTester; - -import static java.lang.String.valueOf; - -public class AddAnalysisUuidColumnToMeasuresTest { - - private static final String TABLE = "project_measures"; - - @Rule - public DbTester db = DbTester.createForSchema(System2.INSTANCE, AddAnalysisUuidColumnToMeasuresTest.class, "old_measures.sql"); - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - private AddAnalysisUuidColumnToMeasures underTest = new AddAnalysisUuidColumnToMeasures(db.database()); - - @Test - public void migration_adds_column_to_empty_table() throws SQLException { - underTest.execute(); - - verifyAddedColumn(); - } - - @Test - public void migration_adds_column_to_populated_table() throws SQLException { - for (int i = 0; i < 9; i++) { - db.executeInsert( - TABLE, - "metric_id", valueOf(i), - "value", valueOf(i + 10), - "snapshot_id", valueOf(i + 100), - "component_uuid", valueOf(i + 1_000) - ); - } - db.commit(); - - underTest.execute(); - - verifyAddedColumn(); - } - - @Test - public void migration_is_not_reentrant() throws SQLException { - underTest.execute(); - - expectedException.expect(IllegalStateException.class); - expectedException.expectMessage("Fail to execute "); - underTest.execute(); - } - - private void verifyAddedColumn() { - db.assertColumnDefinition(TABLE, "analysis_uuid", Types.VARCHAR, 50, true); - } - -} diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest.java deleted file mode 100644 index a2d049ccdfe..00000000000 --- a/sonar-db/src/test/java/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import java.util.List; -import java.util.stream.Collectors; -import javax.annotation.Nullable; -import org.junit.Rule; -import org.junit.Test; -import org.sonar.api.utils.System2; -import org.sonar.db.DbTester; - -import static java.lang.String.valueOf; -import static org.assertj.core.api.Assertions.assertThat; - -public class CleanMeasuresWithNullAnalysisUuidTest { - - private static final String TABLE_MEASURES = "project_measures"; - - @Rule - public DbTester db = DbTester.createForSchema(System2.INSTANCE, CleanMeasuresWithNullAnalysisUuidTest.class, - "in_progress_measures.sql"); - - private CleanMeasuresWithNullAnalysisUuid underTest = new CleanMeasuresWithNullAnalysisUuid(db.database()); - - @Test - public void migration_has_no_effect_on_empty_table() throws SQLException { - underTest.execute(); - - assertThat(db.countRowsOfTable(TABLE_MEASURES)).isEqualTo(0); - } - - @Test - public void migration_deletes_rows_with_null_analysis_uuid() throws SQLException { - insertMeasure(1, "U1"); - insertMeasure(2, "U1"); - insertMeasure(3, null); - db.commit(); - - underTest.execute(); - - assertThat(idsOfRows()).containsOnly(1L, 2L); - } - - @Test - public void migration_is_reentrant() throws SQLException { - insertMeasure(1, "U1"); - insertMeasure(2, null); - db.commit(); - - underTest.execute(); - assertThat(idsOfRows()).containsOnly(1L); - - underTest.execute(); - assertThat(idsOfRows()).containsOnly(1L); - } - - private void insertMeasure(long id, @Nullable String analysisUuid) { - db.executeInsert( - TABLE_MEASURES, - "ID", valueOf(id), - "SNAPSHOT_ID", valueOf(id + 10), - "METRIC_ID", valueOf(id + 100), - "VALUE", valueOf(id + 200), - "COMPONENT_UUID", valueOf(id + 300), - "ANALYSIS_UUID", analysisUuid); - } - - private List<Long> idsOfRows() { - return db.select("select ID from project_measures").stream().map(map -> (Long) map.get("ID")).collect(Collectors.toList()); - } -} diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest.java deleted file mode 100644 index 1c6089bbc4c..00000000000 --- a/sonar-db/src/test/java/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import java.sql.Types; -import javax.annotation.Nullable; -import org.junit.Rule; -import org.junit.Test; -import org.junit.rules.ExpectedException; -import org.sonar.api.utils.System2; -import org.sonar.db.DbTester; - -import static java.lang.String.valueOf; - - -public class MakeAnalysisUuidNotNullOnMeasuresTest { - - private static final String TABLE_MEASURES = "project_measures"; - - @Rule - public DbTester db = DbTester.createForSchema(System2.INSTANCE, MakeAnalysisUuidNotNullOnMeasuresTest.class, - "in_progress_measures.sql"); - - @Rule - public ExpectedException expectedException = ExpectedException.none(); - - private MakeAnalysisUuidNotNullOnMeasures underTest = new MakeAnalysisUuidNotNullOnMeasures(db.database()); - - @Test - public void migration_makes_analysis_uuid_not_nullable_on_empty_table() throws SQLException { - underTest.execute(); - - verifyColumnDefinitions(); - } - - @Test - public void migration_makes_analysis_uuid_not_nullable_on_populated_table() throws SQLException { - insertMeasure(1, "U1"); - insertMeasure(2, "U2"); - - underTest.execute(); - - verifyColumnDefinitions(); - } - - @Test - public void migration_fails_if_some_uuid_columns_are_null() throws SQLException { - insertMeasure(2, null); - - expectedException.expect(IllegalStateException.class); - expectedException.expectMessage("Fail to execute"); - - underTest.execute(); - } - - private void insertMeasure(long id, @Nullable String analysisUuid) { - db.executeInsert( - TABLE_MEASURES, - "ID", valueOf(id), - "SNAPSHOT_ID", valueOf(id + 10), - "METRIC_ID", valueOf(id + 100), - "VALUE", valueOf(id + 200), - "COMPONENT_UUID", valueOf(id + 300), - "ANALYSIS_UUID", analysisUuid); - } - - private void verifyColumnDefinitions() { - db.assertColumnDefinition(TABLE_MEASURES, "analysis_uuid", Types.VARCHAR, 50, false); - } - -} diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest.java deleted file mode 100644 index 54c6c68d2f6..00000000000 --- a/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2016 SonarSource SA - * mailto:contact AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -package org.sonar.db.version.v60; - -import java.sql.SQLException; -import java.util.Map; -import javax.annotation.Nullable; -import org.junit.Rule; -import org.junit.Test; -import org.sonar.api.resources.Qualifiers; -import org.sonar.api.utils.System2; -import org.sonar.db.DbTester; - -import static java.lang.String.valueOf; -import static org.assertj.core.api.Assertions.assertThat; - -public class PopulateAnalysisUuidOnMeasuresTest { - - private static final String TABLE_MEASURES = "project_measures"; - private static final String TABLE_SNAPSHOTS = "snapshots"; - - @Rule - public DbTester db = DbTester.createForSchema(System2.INSTANCE, PopulateAnalysisUuidOnMeasuresTest.class, - "old_measures.sql"); - - private PopulateAnalysisUuidOnMeasures underTest = new PopulateAnalysisUuidOnMeasures(db.database()); - - @Test - public void migration_has_no_effect_on_empty_tables() throws SQLException { - underTest.execute(); - - assertThat(db.countRowsOfTable(TABLE_MEASURES)).isEqualTo(0); - } - - @Test - public void migration_populates_analysis_uuids() throws SQLException { - insertSnapshot(1, "U1", Qualifiers.PROJECT, 1); - insertSnapshot(2, "U2", Qualifiers.DIRECTORY, 1); - insertSnapshot(3, "U3", Qualifiers.FILE, 1); - insertMeasure(21, 1); - insertMeasure(22, 2); - insertMeasure(23, 3); - db.commit(); - - underTest.execute(); - - verifyAnalysisUuid(21, "U1"); - verifyAnalysisUuid(22, "U1"); - verifyAnalysisUuid(23, "U1"); - } - - @Test - public void migration_is_reentrant() throws SQLException { - insertSnapshot(1, "U1", Qualifiers.PROJECT, 1); - insertMeasure(21, 1); - - underTest.execute(); - verifyAnalysisUuid(21, "U1"); - - underTest.execute(); - verifyAnalysisUuid(21, "U1"); - } - - private void verifyAnalysisUuid(int measureId, @Nullable String expectedAnalysisUuid) { - Map<String, Object> rows = db.selectFirst("select analysis_uuid as \"analysisUuid\" from project_measures where id=" + measureId); - assertThat(rows.get("analysisUuid")).isEqualTo(expectedAnalysisUuid); - } - - private String insertSnapshot(long id, String uuid, String qualifier, long rootSnapshotId) { - db.executeInsert( - TABLE_SNAPSHOTS, - "ID", valueOf(id), - "UUID", uuid, - "COMPONENT_UUID", valueOf(id + 10), - "ROOT_COMPONENT_UUID", valueOf(id + 10), - "ROOT_SNAPSHOT_ID", valueOf(rootSnapshotId), - "QUALIFIER", qualifier); - return uuid; - } - - private void insertMeasure(long id, long snapshotId) { - db.executeInsert( - TABLE_MEASURES, - "ID", valueOf(id), - "SNAPSHOT_ID", valueOf(snapshotId), - "METRIC_ID", valueOf(id + 100), - "VALUE", valueOf(id + 200), - "COMPONENT_UUID", valueOf(id + 300)); - } -} diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml index 2072fa6c6a3..e2080221686 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/insert-result.xml @@ -2,7 +2,6 @@ <project_measures id="1" snapshot_id="2" - analysis_uuid="u2" metric_id="3" component_uuid="FILE1" person_id="23" diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml index 5fb9ee56984..635d065eadf 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml @@ -137,7 +137,6 @@ VALUE="60" METRIC_ID="1" SNAPSHOT_ID="1000" - analysis_uuid="u1000" person_id="[null]" component_uuid="ABCD"/> @@ -145,7 +144,6 @@ VALUE="80" METRIC_ID="2" SNAPSHOT_ID="1000" - analysis_uuid="u1000" person_id="[null]" component_uuid="ABCD"/> @@ -154,7 +152,6 @@ VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1001" - analysis_uuid="u1000" person_id="[null]" component_uuid="BCDE"/> @@ -162,7 +159,6 @@ VALUE="70" METRIC_ID="2" SNAPSHOT_ID="1001" - analysis_uuid="u1000" person_id="[null]" component_uuid="BCDE"/> @@ -171,7 +167,6 @@ VALUE="5" METRIC_ID="1" SNAPSHOT_ID="1002" - analysis_uuid="u1000" person_id="[null]" component_uuid="CDEF"/> @@ -179,7 +174,6 @@ VALUE="60" METRIC_ID="2" SNAPSHOT_ID="1002" - analysis_uuid="u1000" person_id="[null]" component_uuid="CDEF"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml index 260f36f3c49..90bae067103 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml @@ -44,7 +44,6 @@ VALUE="60" METRIC_ID="1" SNAPSHOT_ID="1000" - analysis_uuid="u1000" person_id="[null]" component_uuid="ABCD"/> @@ -52,7 +51,6 @@ VALUE="20" METRIC_ID="1" SNAPSHOT_ID="1000" - analysis_uuid="u1000" person_id="20" component_uuid="ABCD"/> @@ -60,7 +58,6 @@ VALUE="40" METRIC_ID="1" SNAPSHOT_ID="1000" - analysis_uuid="u1000" person_id="21" component_uuid="ABCD"/> diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml index bdd864aa9ee..8c287369351 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml @@ -22,7 +22,6 @@ <project_measures id="20" snapshot_id="5" - analysis_uuid="u5" metric_id="10" value="[null]" text_value="0123456789012345678901234567890123456789" @@ -37,7 +36,6 @@ component_uuid="FILE1"/> <project_measures id="21" snapshot_id="5" - analysis_uuid="u5" metric_id="11" value="[null]" text_value="36=1;37=1;38=1;39=1;43=1;48=1;53=1" @@ -52,7 +50,6 @@ component_uuid="FILE1"/> <project_measures id="22" snapshot_id="5" - analysis_uuid="u5" metric_id="12" value="10" text_value="[null]" diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml index a85ddeba88c..66240b47fac 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml @@ -23,7 +23,6 @@ <project_measures id="20" component_uuid="ABCD" snapshot_id="5" - analysis_uuid="u5" metric_id="10" value="[null]" text_value="0123456789012345678901234567890123456789" @@ -38,7 +37,6 @@ <project_measures id="21" component_uuid="ABCD" snapshot_id="5" - analysis_uuid="u5" metric_id="11" value="[null]" text_value="36=1;37=1;38=1;39=1;43=1;48=1;53=1" @@ -53,7 +51,6 @@ <project_measures id="22" component_uuid="ABCD" snapshot_id="5" - analysis_uuid="u5" metric_id="12" value="10" text_value="[null]" diff --git a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml index 4d93914c15f..eea4becd304 100644 --- a/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml +++ b/sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml @@ -28,7 +28,6 @@ <project_measures id="20" snapshot_id="5" - analysis_uuid="u5" metric_id="10" value="[null]" text_value="0123456789012345678901234567890123456789" @@ -44,7 +43,6 @@ component_uuid="1"/> <project_measures id="21" snapshot_id="5" - analysis_uuid="u5" metric_id="11" value="[null]" text_value="36=1;37=1;38=1;39=1;43=1;48=1;53=1" @@ -60,7 +58,6 @@ component_uuid="1"/> <project_measures id="22" snapshot_id="5" - analysis_uuid="u5" metric_id="12" value="10" text_value="[null]" @@ -77,7 +74,6 @@ <!--measures for developer 333--> <project_measures id="30" snapshot_id="5" - analysis_uuid="u5" metric_id="10" value="[null]" text_value="0123456789012345678901234567890123456789" @@ -93,7 +89,6 @@ component_uuid="1"/> <project_measures id="31" snapshot_id="5" - analysis_uuid="u5" metric_id="11" value="[null]" text_value="36=1;37=1;38=1;39=1;43=1;48=1;53=1" @@ -109,7 +104,6 @@ component_uuid="1"/> <project_measures id="32" snapshot_id="5" - analysis_uuid="u5" metric_id="12" value="10" text_value="[null]" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml index b8decef6de6..ed1010681e7 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml @@ -43,7 +43,6 @@ VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" - analysis_uuid="u1" person_id="[null]" text_value="[null]" component_uuid="1" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml index 19d9d045a89..7749f051668 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml @@ -43,7 +43,6 @@ VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="1" - analysis_uuid="u1" person_id="[null]" text_value="[null]" component_uuid="1" @@ -111,7 +110,6 @@ VALUE="10.0" METRIC_ID="1" SNAPSHOT_ID="5" - analysis_uuid="u5" person_id="[null]" text_value="[null]" component_uuid="5" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml index e3297878a6e..8532d9c5584 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml @@ -1,82 +1,37 @@ <dataset> - <metrics id="1" - delete_historical_data="[null]" - name="ncloc" - val_type="INT" - description="[null]" - domain="[null]" - short_name="" - enabled="[true]" - worst_value="[null]" - optimized_best_value="[null]" - best_value="[null]" - direction="0" - hidden="[false]"/> + <metrics id="1" delete_historical_data="[null]" + name="ncloc" val_type="INT" description="[null]" domain="[null]" short_name="" enabled="[true]" + worst_value="[null]" optimized_best_value="[null]" best_value="[null]" + direction="0" hidden="[false]"/> - <metrics id="2" - delete_historical_data="[true]" - name="coverage" - val_type="INT" - description="[null]" - domain="[null]" - short_name="" - enabled="[true]" - worst_value="0" - optimized_best_value="[true]" - best_value="100" - direction="1" - hidden="[false]"/> + <metrics id="2" delete_historical_data="[true]" + name="coverage" val_type="INT" description="[null]" domain="[null]" short_name="" enabled="[true]" + worst_value="0" optimized_best_value="[true]" best_value="100" + direction="1" hidden="[false]"/> <snapshots id="1" uuid="u1" - project_id="1" - parent_snapshot_id="[null]" - root_project_id="1" - root_snapshot_id="[null]" - status="P" - islast="[true]" - purge_status="[null]" - period1_mode="[null]" - period1_param="[null]" - period1_date="[null]" - period2_mode="[null]" - period2_param="[null]" - period2_date="[null]" - period3_mode="[null]" - period3_param="[null]" - period3_date="[null]" - period4_mode="[null]" - period4_param="[null]" - period4_date="[null]" - period5_mode="[null]" - period5_param="[null]" - period5_date="[null]" - depth="[null]" - scope="PRJ" - qualifier="TRK" - created_at="1228222680000" - build_date="1228222680000" - version="[null]" - path="[null]"/> + project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]" + status="P" islast="[true]" purge_status="[null]" + period1_mode="[null]" period1_param="[null]" period1_date="[null]" + period2_mode="[null]" period2_param="[null]" period2_date="[null]" + period3_mode="[null]" period3_param="[null]" period3_date="[null]" + period4_mode="[null]" period4_param="[null]" period4_date="[null]" + period5_mode="[null]" period5_param="[null]" period5_date="[null]" + depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" + build_date="1228222680000" version="[null]" path="[null]"/> <!-- do not delete standard measure --> <project_measures id="1" snapshot_id="1" - analysis_uuid="u1" metric_id="1" component_uuid="1" - variation_value_1="[null]" - variation_value_2="[null]" - variation_value_3="[null]" + variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" - variation_value_5="[null]" - alert_text="[null]" - value="10.0" + variation_value_5="[null]" alert_text="[null]" value="10.0" person_id="[null]" - text_value="[null]" - alert_status="[null]" - description="[null]" - measure_data="[null]"/> + text_value="[null]" alert_status="[null]" + description="[null]" measure_data="[null]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml index 9e9b5547c89..24dc9ac4a3b 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml @@ -1,32 +1,14 @@ <dataset> - <metrics id="1" - delete_historical_data="[null]" - name="ncloc" - val_type="INT" - description="[null]" - domain="[null]" - short_name="" - enabled="[true]" - worst_value="[null]" - optimized_best_value="[null]" - best_value="[null]" - direction="0" - hidden="[false]"/> + <metrics id="1" delete_historical_data="[null]" + name="ncloc" val_type="INT" description="[null]" domain="[null]" short_name="" enabled="[true]" + worst_value="[null]" optimized_best_value="[null]" best_value="[null]" + direction="0" hidden="[false]"/> - <metrics id="2" - delete_historical_data="[true]" - name="coverage" - val_type="INT" - description="[null]" - domain="[null]" - short_name="" - enabled="[true]" - worst_value="0" - optimized_best_value="[true]" - best_value="100" - direction="1" - hidden="[false]"/> + <metrics id="2" delete_historical_data="[true]" + name="coverage" val_type="INT" description="[null]" domain="[null]" short_name="" enabled="[true]" + worst_value="0" optimized_best_value="[true]" best_value="100" + direction="1" hidden="[false]"/> <snapshots id="1" uuid="u1" @@ -34,88 +16,46 @@ parent_snapshot_id="[null]" root_component_uuid="uuid_1" root_snapshot_id="[null]" - status="P" - islast="[true]" + status="P" islast="[true]" purge_status="[null]" - period1_mode="[null]" - period1_param="[null]" - period1_date="[null]" - period2_mode="[null]" - period2_param="[null]" - period2_date="[null]" - period3_mode="[null]" - period3_param="[null]" - period3_date="[null]" - period4_mode="[null]" - period4_param="[null]" - period4_date="[null]" - period5_mode="[null]" - period5_param="[null]" - period5_date="[null]" - depth="[null]" - scope="PRJ" - qualifier="TRK" - created_at="1228222680000" - build_date="1228222680000" - version="[null]" - path="[null]"/> + period1_mode="[null]" period1_param="[null]" period1_date="[null]" + period2_mode="[null]" period2_param="[null]" period2_date="[null]" + period3_mode="[null]" period3_param="[null]" period3_date="[null]" + period4_mode="[null]" period4_param="[null]" period4_date="[null]" + period5_mode="[null]" period5_param="[null]" period5_date="[null]" + depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" + build_date="1228222680000" version="[null]" path="[null]"/> <!-- do not delete standard measure --> <project_measures id="1" component_uuid="1" - snapshot_id="1" - analysis_uuid="u1" - metric_id="1" - variation_value_1="[null]" - variation_value_2="[null]" - variation_value_3="[null]" + snapshot_id="1" metric_id="1" + variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" - variation_value_5="[null]" - alert_text="[null]" - value="10.0" + variation_value_5="[null]" alert_text="[null]" value="10.0" person_id="[null]" - text_value="[null]" - alert_status="[null]" - description="[null]" - measure_data="[null]"/> + text_value="[null]" alert_status="[null]" + description="[null]" measure_data="[null]"/> <!-- delete measure on metrics that are flagged with delete_historical_data=true --> <project_measures id="6" component_uuid="1" - snapshot_id="1" - analysis_uuid="u1" - metric_id="2" - variation_value_1="[null]" - variation_value_2="[null]" - variation_value_3="[null]" + snapshot_id="1" metric_id="2" + variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" - variation_value_5="[null]" - alert_text="[null]" - value="10.0" + variation_value_5="[null]" alert_text="[null]" value="10.0" person_id="[null]" - text_value="[null]" - alert_status="[null]" - description="[null]" - measure_data="[null]"/> + text_value="[null]" alert_status="[null]" + description="[null]" measure_data="[null]"/> <!-- delete measure on developers --> <project_measures id="7" component_uuid="1" - snapshot_id="1" - analysis_uuid="u1" - metric_id="2" - variation_value_1="[null]" - variation_value_2="[null]" - variation_value_3="[null]" + snapshot_id="1" metric_id="2" + variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" person_id="123456" variation_value_4="[null]" - variation_value_5="[null]" - alert_text="[null]" - value="10.0" - text_value="[null]" - tendency="[null]" - measure_date="[null]" - alert_status="[null]" - description="[null]" - measure_data="[null]"/> + variation_value_5="[null]" alert_text="[null]" value="10.0" + text_value="[null]" tendency="[null]" measure_date="[null]" alert_status="[null]" + description="[null]" measure_data="[null]"/> </dataset> diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml index 4963f5ed5c4..25a719d851a 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml @@ -48,7 +48,6 @@ Note that measures, events and reviews are not deleted. <project_measures ID="1" component_uuid="1" SNAPSHOT_ID="1" - analysis_uuid="u1" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -114,7 +113,6 @@ Note that measures, events and reviews are not deleted. <project_measures ID="2" component_uuid="2" SNAPSHOT_ID="2" - analysis_uuid="u2" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" diff --git a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml index d42dbd85c8b..a77b0c19077 100644 --- a/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml +++ b/sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml @@ -35,7 +35,6 @@ <project_measures ID="1" component_uuid="1" SNAPSHOT_ID="1" - analysis_uuid="u1" variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" @@ -105,7 +104,6 @@ <project_measures ID="2" component_uuid="2" SNAPSHOT_ID="2" - analysis_uuid="u2" characteristic_id="[null]" variation_value_1="[null]" variation_value_2="[null]" diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest/old_measures.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest/old_measures.sql deleted file mode 100644 index 2f918746508..00000000000 --- a/sonar-db/src/test/resources/org/sonar/db/version/v60/AddAnalysisUuidColumnToMeasuresTest/old_measures.sql +++ /dev/null @@ -1,18 +0,0 @@ -CREATE TABLE "PROJECT_MEASURES" ( - "ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), - "VALUE" DOUBLE, - "METRIC_ID" INTEGER NOT NULL, - "COMPONENT_UUID" VARCHAR(50) NOT NULL, - "SNAPSHOT_ID" INTEGER, - "TEXT_VALUE" VARCHAR(4000), - "ALERT_STATUS" VARCHAR(5), - "ALERT_TEXT" VARCHAR(4000), - "DESCRIPTION" VARCHAR(4000), - "PERSON_ID" INTEGER, - "VARIATION_VALUE_1" DOUBLE, - "VARIATION_VALUE_2" DOUBLE, - "VARIATION_VALUE_3" DOUBLE, - "VARIATION_VALUE_4" DOUBLE, - "VARIATION_VALUE_5" DOUBLE, - "MEASURE_DATA" BINARY(167772150) - ); diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest/in_progress_measures.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest/in_progress_measures.sql deleted file mode 100644 index 5f58ad529ce..00000000000 --- a/sonar-db/src/test/resources/org/sonar/db/version/v60/CleanMeasuresWithNullAnalysisUuidTest/in_progress_measures.sql +++ /dev/null @@ -1,20 +0,0 @@ -CREATE TABLE "PROJECT_MEASURES" ( - "ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), - "VALUE" DOUBLE, - "METRIC_ID" INTEGER NOT NULL, - "COMPONENT_UUID" VARCHAR(50) NOT NULL, - "SNAPSHOT_ID" INTEGER, - // NULLABLE at that time - "ANALYSIS_UUID" VARCHAR(50), - "TEXT_VALUE" VARCHAR(4000), - "ALERT_STATUS" VARCHAR(5), - "ALERT_TEXT" VARCHAR(4000), - "DESCRIPTION" VARCHAR(4000), - "PERSON_ID" INTEGER, - "VARIATION_VALUE_1" DOUBLE, - "VARIATION_VALUE_2" DOUBLE, - "VARIATION_VALUE_3" DOUBLE, - "VARIATION_VALUE_4" DOUBLE, - "VARIATION_VALUE_5" DOUBLE, - "MEASURE_DATA" BINARY(167772150) - ); diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest/in_progress_measures.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest/in_progress_measures.sql deleted file mode 100644 index 5f58ad529ce..00000000000 --- a/sonar-db/src/test/resources/org/sonar/db/version/v60/MakeAnalysisUuidNotNullOnMeasuresTest/in_progress_measures.sql +++ /dev/null @@ -1,20 +0,0 @@ -CREATE TABLE "PROJECT_MEASURES" ( - "ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), - "VALUE" DOUBLE, - "METRIC_ID" INTEGER NOT NULL, - "COMPONENT_UUID" VARCHAR(50) NOT NULL, - "SNAPSHOT_ID" INTEGER, - // NULLABLE at that time - "ANALYSIS_UUID" VARCHAR(50), - "TEXT_VALUE" VARCHAR(4000), - "ALERT_STATUS" VARCHAR(5), - "ALERT_TEXT" VARCHAR(4000), - "DESCRIPTION" VARCHAR(4000), - "PERSON_ID" INTEGER, - "VARIATION_VALUE_1" DOUBLE, - "VARIATION_VALUE_2" DOUBLE, - "VARIATION_VALUE_3" DOUBLE, - "VARIATION_VALUE_4" DOUBLE, - "VARIATION_VALUE_5" DOUBLE, - "MEASURE_DATA" BINARY(167772150) - ); diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest/old_measures.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest/old_measures.sql deleted file mode 100644 index 203419ad2bd..00000000000 --- a/sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateAnalysisUuidOnMeasuresTest/old_measures.sql +++ /dev/null @@ -1,54 +0,0 @@ -CREATE TABLE "SNAPSHOTS" ( - "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), - "UUID" VARCHAR(50) NOT NULL, - "CREATED_AT" BIGINT, - "BUILD_DATE" BIGINT, - "COMPONENT_UUID" VARCHAR(50) NOT NULL, - "PARENT_SNAPSHOT_ID" INTEGER, - "STATUS" VARCHAR(4) NOT NULL DEFAULT 'U', - "PURGE_STATUS" INTEGER, - "ISLAST" BOOLEAN NOT NULL DEFAULT FALSE, - "SCOPE" VARCHAR(3), - "QUALIFIER" VARCHAR(10), - "ROOT_SNAPSHOT_ID" INTEGER, - "VERSION" VARCHAR(500), - "PATH" VARCHAR(500), - "DEPTH" INTEGER, - "ROOT_COMPONENT_UUID" VARCHAR(50) NOT NULL, - "PERIOD1_MODE" VARCHAR(100), - "PERIOD1_PARAM" VARCHAR(100), - "PERIOD1_DATE" BIGINT, - "PERIOD2_MODE" VARCHAR(100), - "PERIOD2_PARAM" VARCHAR(100), - "PERIOD2_DATE" BIGINT, - "PERIOD3_MODE" VARCHAR(100), - "PERIOD3_PARAM" VARCHAR(100), - "PERIOD3_DATE" BIGINT, - "PERIOD4_MODE" VARCHAR(100), - "PERIOD4_PARAM" VARCHAR(100), - "PERIOD4_DATE" BIGINT, - "PERIOD5_MODE" VARCHAR(100), - "PERIOD5_PARAM" VARCHAR(100), - "PERIOD5_DATE" BIGINT -); - -CREATE TABLE "PROJECT_MEASURES" ( - "ID" BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1), - "VALUE" DOUBLE, - "METRIC_ID" INTEGER NOT NULL, - "COMPONENT_UUID" VARCHAR(50) NOT NULL, - "SNAPSHOT_ID" INTEGER, - // NULLABLE at that time - "ANALYSIS_UUID" VARCHAR(50), - "TEXT_VALUE" VARCHAR(4000), - "ALERT_STATUS" VARCHAR(5), - "ALERT_TEXT" VARCHAR(4000), - "DESCRIPTION" VARCHAR(4000), - "PERSON_ID" INTEGER, - "VARIATION_VALUE_1" DOUBLE, - "VARIATION_VALUE_2" DOUBLE, - "VARIATION_VALUE_3" DOUBLE, - "VARIATION_VALUE_4" DOUBLE, - "VARIATION_VALUE_5" DOUBLE, - "MEASURE_DATA" BINARY(167772150) - ); |