]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7779 Add column UUID to table SNAPSHOTS
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Thu, 16 Jun 2016 16:20:36 +0000 (18:20 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 17 Jun 2016 18:09:28 +0000 (20:09 +0200)
135 files changed:
server/sonar-server/src/main/java/org/sonar/server/computation/analysis/AnalysisMetadataHolder.java
server/sonar-server/src/main/java/org/sonar/server/computation/analysis/AnalysisMetadataHolderImpl.java
server/sonar-server/src/main/java/org/sonar/server/computation/analysis/MutableAnalysisMetadataHolder.java
server/sonar-server/src/main/java/org/sonar/server/computation/step/GenerateAnalysisUuid.java [new file with mode: 0644]
server/sonar-server/src/main/java/org/sonar/server/computation/step/PersistSnapshotsStep.java
server/sonar-server/src/main/java/org/sonar/server/computation/step/ReportComputationSteps.java
server/sonar-server/src/test/java/org/sonar/server/computation/analysis/AnalysisMetadataHolderRule.java
server/sonar-server/src/test/java/org/sonar/server/computation/analysis/MutableAnalysisMetadataHolderRule.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/ReportPersistSnapshotsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/computation/step/ViewsPersistSnapshotsStepTest.java
server/sonar-server/src/test/java/org/sonar/server/ui/ws/ComponentNavigationActionTest.java
server/sonar-server/src/test/resources/org/sonar/server/computation/activity/ActivityManagerTest/shared.xml
server/sonar-server/src/test/resources/org/sonar/server/computation/measure/MeasureRepositoryImplTest/shared.xml
server/sonar-server/src/test/resources/org/sonar/server/computation/step/FillMeasuresWithVariationsStepTest/shared.xml
server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/no_previous_version.xml
server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/previous_version_deleted.xml
server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/previous_version_is_last_one.xml
server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/shared.xml
server/sonar-server/src/test/resources/org/sonar/server/computation/step/LoadPeriodsStepTest/unprocessed_snapshots.xml
server/sonar-server/src/test/resources/org/sonar/server/computation/step/SwitchSnapshotStepTest/snapshots-result.xml
server/sonar-server/src/test/resources/org/sonar/server/computation/step/SwitchSnapshotStepTest/snapshots.xml
server/sonar-server/src/test/resources/org/sonar/server/filters/FilterExecutorTest/views.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/load_component_id_from_db.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/load_project_id_from_db.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_insert_new_issues.xml
server/sonar-server/src/test/resources/org/sonar/server/issue/ServerIssueStorageTest/should_update_issues.xml
server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/escape_percent_and_underscore_when_filter_by_component_name_or_key.xml
server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_person_measures.xml
server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/ignore_quality_model_measures.xml
server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/shared.xml
server/sonar-server/src/test/resources/org/sonar/server/measure/MeasureFilterExecutorTest/sort_by_alert.xml
server/sonar-server/src/test/resources/org/sonar/server/platform/BackendCleanupMediumTest/shared.xml
server/sonar-server/src/test/resources/org/sonar/server/view/index/ViewIndexerTest/index.xml
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1208_add_component_uuid_columns_to_snapshots.rb [new file with mode: 0644]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1208_add_uuid_columns_to_snapshots.rb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1209_populate_component_uuid_columns_of_snapshots.rb [new file with mode: 0644]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1209_populate_uuid_columns_of_snapshots.rb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1211_make_component_uuid_columns_not_null_on_snapshots.rb [new file with mode: 0644]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1211_make_uuid_columns_not_null_on_snapshots.rb [deleted file]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1228_add_uuid_column_to_snapshots.rb [new file with mode: 0644]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1229_populate_uuid_column_on_snapshots.rb [new file with mode: 0644]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1230_make_uuid_column_not_null_on_snapshots.rb [new file with mode: 0644]
server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1231_add_unique_index_on_uuid_of_snapshots.rb [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/component/SnapshotDto.java
sonar-db/src/main/java/org/sonar/db/version/DatabaseVersion.java
sonar-db/src/main/java/org/sonar/db/version/MigrationStepModule.java
sonar-db/src/main/java/org/sonar/db/version/v60/AddComponentUuidColumnsToSnapshots.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/version/v60/AddUuidColumnToSnapshots.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/version/v60/AddUuidColumnsToSnapshots.java [deleted file]
sonar-db/src/main/java/org/sonar/db/version/v60/MakeComponentUuidColumnsNotNullOnSnapshots.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/version/v60/MakeUuidColumnNotNullOnSnapshots.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/version/v60/MakeUuidColumnsNotNullOnSnapshots.java [deleted file]
sonar-db/src/main/java/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshots.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/version/v60/PopulateUuidColumnOnSnapshots.java [new file with mode: 0644]
sonar-db/src/main/java/org/sonar/db/version/v60/PopulateUuidColumnsOfSnapshots.java [deleted file]
sonar-db/src/main/resources/org/sonar/db/component/SnapshotMapper.xml
sonar-db/src/main/resources/org/sonar/db/version/rows-h2.sql
sonar-db/src/main/resources/org/sonar/db/version/schema-h2.ddl
sonar-db/src/test/java/org/sonar/db/component/ResourceIndexDaoTest.java
sonar-db/src/test/java/org/sonar/db/component/SnapshotDaoTest.java
sonar-db/src/test/java/org/sonar/db/component/SnapshotTesting.java
sonar-db/src/test/java/org/sonar/db/measure/MeasureDaoTest.java
sonar-db/src/test/java/org/sonar/db/version/MigrationStepModuleTest.java
sonar-db/src/test/java/org/sonar/db/version/v60/AddComponentUuidColumnsToSnapshotsTest.java [new file with mode: 0644]
sonar-db/src/test/java/org/sonar/db/version/v60/AddUuidColumnToSnapshotsTest.java [new file with mode: 0644]
sonar-db/src/test/java/org/sonar/db/version/v60/AddUuidColumnsToSnapshotsTest.java [deleted file]
sonar-db/src/test/java/org/sonar/db/version/v60/MakeComponentUuidColumnsNotNullOnSnapshotsTest.java [new file with mode: 0644]
sonar-db/src/test/java/org/sonar/db/version/v60/MakeUuidColumnNotNullOnSnapshotsTest.java [new file with mode: 0644]
sonar-db/src/test/java/org/sonar/db/version/v60/MakeUuidColumnsNotNullOnSnapshotsTest.java [deleted file]
sonar-db/src/test/java/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshotsTest.java [new file with mode: 0644]
sonar-db/src/test/java/org/sonar/db/version/v60/PopulateUuidColumnOnSnapshotsTest.java [new file with mode: 0644]
sonar-db/src/test/java/org/sonar/db/version/v60/PopulateUuidColumnsOfSnapshotsTest.java [deleted file]
sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/multi-modules.xml
sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_ghost_projects.xml
sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/select_provisioned_projects.xml
sonar-db/src/test/resources/org/sonar/db/component/ComponentDaoTest/shared.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture-including-ghost-projects-and-technical-project.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/fixture.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceDaoTest/get_last_snapshot_by_component_uuid.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject-result.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexMultiModulesProject.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldIndexProjects-result.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldNotIndexPackages.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReIndexNewTwoLettersLongResource.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReIndexTwoLettersLongResource.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReindexProjectAfterRenaming-result.xml
sonar-db/src/test/resources/org/sonar/db/component/ResourceIndexDaoTest/shouldReindexProjectAfterRenaming.xml
sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/has_last_snapshot_by_component_uuid.xml
sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/insert-result.xml
sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/modules.xml
sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_previous_version_snapshots.xml
sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/select_snapshots_by_query.xml
sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/shared.xml
sonar-db/src/test/resources/org/sonar/db/component/SnapshotDaoTest/snapshots.xml
sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/insert-result.xml
sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/insert.xml
sonar-db/src/test/resources/org/sonar/db/duplication/DuplicationDaoTest/select_candidates.xml
sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures.xml
sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/past_measures_with_person_id.xml
sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/select_by_snapshot_and_metric_keys.xml
sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/shared.xml
sonar-db/src/test/resources/org/sonar/db/measure/MeasureDaoTest/with_some_measures_for_developer.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteResource.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot-result.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteSnapshot.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot-result.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldDeleteWastedMeasuresWhenPurgingSnapshot.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeSnapshot-result.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeCommandsTest/shouldPurgeSnapshot.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/delete_file_sources_of_disabled_resources.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot-result.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/disable_resources_without_last_snapshot.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds-result.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteAbortedBuilds.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles-result.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteHistoricalDataOfDirectoriesAndFiles.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteProject.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteSnapshots-result.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldDeleteSnapshots.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject-result.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldPurgeProject.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/shouldSelectPurgeableSnapshots.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues-result.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_all_closed_issues.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues-result.xml
sonar-db/src/test/resources/org/sonar/db/purge/PurgeDaoTest/should_delete_old_closed_issues.xml
sonar-db/src/test/resources/org/sonar/db/version/v60/AddComponentUuidColumnsToSnapshotsTest/old_snapshots.sql [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/version/v60/AddUuidColumnToSnapshotsTest/old_snapshots.sql [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/version/v60/AddUuidColumnsToSnapshotsTest/old_snapshots.sql [deleted file]
sonar-db/src/test/resources/org/sonar/db/version/v60/MakeComponentUuidColumnsNotNullOnSnapshotsTest/in_progress_snapshots.sql [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/version/v60/MakeUuidColumnNotNullOnSnapshotsTest/in_progress_snapshots.sql [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/version/v60/MakeUuidColumnsNotNullOnSnapshotsTest/in_progress_snapshots.sql [deleted file]
sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshotsTest/in_progress_snapshots_with_projects.sql [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateUuidColumnOnSnapshotsTest/in_progress_snapshots.sql [new file with mode: 0644]
sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateUuidColumnsOfSnapshotsTest/in_progress_snapshots_with_projects.sql [deleted file]

index 93565cabbd30da15d57683e387d2f9a9515508a9..020c1dd7fd026a4f13b11bb62573298858de84c1 100644 (file)
@@ -25,6 +25,13 @@ import org.sonar.server.computation.qualityprofile.QualityProfile;
 import org.sonar.server.computation.snapshot.Snapshot;
 
 public interface AnalysisMetadataHolder {
+
+  /**
+   * Returns the UUID generated for this analysis.
+   * @throws IllegalStateException if uuid has not been set
+   */
+  String getUuid();
+
   /**
    * @throws IllegalStateException if no analysis date has been set
    */
index 003d0c7509f39dc82c2b318f722c81bc1e66515b..e13cc9ec850b8aba16a6f2953eb1d2d6f250f26a 100644 (file)
@@ -31,17 +31,26 @@ import static com.google.common.base.Preconditions.checkState;
 
 public class AnalysisMetadataHolderImpl implements MutableAnalysisMetadataHolder {
 
-  private InitializedProperty<Long> analysisDate = new InitializedProperty<>();
+  private final InitializedProperty<String> uuid = new InitializedProperty<>();
 
-  private InitializedProperty<Snapshot> baseProjectSnapshot = new InitializedProperty<>();
+  private final InitializedProperty<Long> analysisDate = new InitializedProperty<>();
 
-  private InitializedProperty<Boolean> crossProjectDuplicationEnabled = new InitializedProperty<>();
+  private final InitializedProperty<Snapshot> baseProjectSnapshot = new InitializedProperty<>();
 
-  private InitializedProperty<String> branch = new InitializedProperty<>();
+  private final InitializedProperty<Boolean> crossProjectDuplicationEnabled = new InitializedProperty<>();
 
-  private InitializedProperty<Integer> rootComponentRef = new InitializedProperty<>();
+  private final InitializedProperty<String> branch = new InitializedProperty<>();
 
-  private InitializedProperty<Map<String, QualityProfile>> qProfilesPerLanguage = new InitializedProperty<>();
+  private final InitializedProperty<Integer> rootComponentRef = new InitializedProperty<>();
+
+  private final InitializedProperty<Map<String, QualityProfile>> qProfilesPerLanguage = new InitializedProperty<>();
+
+  @Override
+  public MutableAnalysisMetadataHolder setUuid(String s) {
+    checkState(!uuid.isInitialized(), "Analysis uuid has already been set");
+    this.uuid.setProperty(s);
+    return this;
+  }
 
   @Override
   public MutableAnalysisMetadataHolder setAnalysisDate(long date) {
@@ -50,6 +59,12 @@ public class AnalysisMetadataHolderImpl implements MutableAnalysisMetadataHolder
     return this;
   }
 
+  @Override
+  public String getUuid() {
+    checkState(uuid.isInitialized(), "Analysis uuid has not been set");
+    return this.uuid.getProperty();
+  }
+
   @Override
   public long getAnalysisDate() {
     checkState(analysisDate.isInitialized(), "Analysis date has not been set");
index 20326ee5ec1d54dc2c45242f857d3b26bb2b46e5..c9eb49425ec2245a43e0e4b859cfe6edb6973ada 100644 (file)
@@ -26,6 +26,11 @@ import org.sonar.server.computation.snapshot.Snapshot;
 
 public interface MutableAnalysisMetadataHolder extends AnalysisMetadataHolder {
 
+  /**
+   * @throws IllegalStateException if the analysis uuid has already been set
+   */
+  MutableAnalysisMetadataHolder setUuid(String uuid);
+
   /**
    * @throws IllegalStateException if the analysis date has already been set
    */
diff --git a/server/sonar-server/src/main/java/org/sonar/server/computation/step/GenerateAnalysisUuid.java b/server/sonar-server/src/main/java/org/sonar/server/computation/step/GenerateAnalysisUuid.java
new file mode 100644 (file)
index 0000000..2140b9e
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * 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.server.computation.step;
+
+import org.sonar.core.util.UuidFactory;
+import org.sonar.server.computation.analysis.MutableAnalysisMetadataHolder;
+
+public class GenerateAnalysisUuid implements ComputationStep {
+
+  private final UuidFactory uuidFactory;
+  private final MutableAnalysisMetadataHolder analysisMetadataHolder;
+
+  public GenerateAnalysisUuid(UuidFactory uuidFactory, MutableAnalysisMetadataHolder analysisMetadataHolder) {
+    this.uuidFactory = uuidFactory;
+    this.analysisMetadataHolder = analysisMetadataHolder;
+  }
+
+  @Override
+  public void execute() {
+    analysisMetadataHolder.setUuid(uuidFactory.create());
+  }
+
+  @Override
+  public String getDescription() {
+    return "Generate analysis UUID";
+  }
+}
index 3e2deea6419e4268654337ee67af3c1e06117a84..5bd0b00489d98494ec50b44b3282f31eddfaa2bf 100644 (file)
@@ -24,6 +24,7 @@ import javax.annotation.Nullable;
 import org.sonar.api.resources.Qualifiers;
 import org.sonar.api.resources.Scopes;
 import org.sonar.api.utils.System2;
+import org.sonar.core.util.Uuids;
 import org.sonar.db.DbClient;
 import org.sonar.db.DbSession;
 import org.sonar.db.component.SnapshotDto;
@@ -92,48 +93,48 @@ public class PersistSnapshotsStep implements ComputationStep {
     @Override
     public void visitProject(Component project, Path<SnapshotDtoHolder> path) {
       this.rootUuid = project.getUuid();
-      SnapshotDto snapshot = createSnapshot(project, path, Qualifiers.PROJECT, Scopes.PROJECT, true);
+      SnapshotDto snapshot = createSnapshot(analysisMetadataHolder.getUuid(), project, path, Qualifiers.PROJECT, Scopes.PROJECT, true);
       updateSnapshotPeriods(snapshot);
       commonForAnyVisit(project, path, snapshot);
     }
 
     @Override
     public void visitModule(Component module, Path<SnapshotDtoHolder> path) {
-      SnapshotDto snapshot = createSnapshot(module, path, Qualifiers.MODULE, Scopes.PROJECT, true);
+      SnapshotDto snapshot = createSnapshot(Uuids.create(), module, path, Qualifiers.MODULE, Scopes.PROJECT, true);
       updateSnapshotPeriods(snapshot);
       commonForAnyVisit(module, path, snapshot);
     }
 
     @Override
     public void visitDirectory(Component directory, Path<SnapshotDtoHolder> path) {
-      SnapshotDto snapshot = createSnapshot(directory, path, Qualifiers.DIRECTORY, Scopes.DIRECTORY, false);
+      SnapshotDto snapshot = createSnapshot(Uuids.create(), directory, path, Qualifiers.DIRECTORY, Scopes.DIRECTORY, false);
       commonForAnyVisit(directory, path, snapshot);
     }
 
     @Override
     public void visitFile(Component file, Path<SnapshotDtoHolder> path) {
-      SnapshotDto snapshot = createSnapshot(file, path, getFileQualifier(file), Scopes.FILE, false);
+      SnapshotDto snapshot = createSnapshot(Uuids.create(), file, path, getFileQualifier(file), Scopes.FILE, false);
       commonForAnyVisit(file, path, snapshot);
     }
 
     @Override
     public void visitView(Component view, Path<SnapshotDtoHolder> path) {
       this.rootUuid = view.getUuid();
-      SnapshotDto snapshot = createSnapshot(view, path, Qualifiers.VIEW, Scopes.PROJECT, false);
+      SnapshotDto snapshot = createSnapshot(Uuids.create(), view, path, Qualifiers.VIEW, Scopes.PROJECT, false);
       updateSnapshotPeriods(snapshot);
       commonForAnyVisit(view, path, snapshot);
     }
 
     @Override
     public void visitSubView(Component subView, Path<SnapshotDtoHolder> path) {
-      SnapshotDto snapshot = createSnapshot(subView, path, Qualifiers.SUBVIEW, Scopes.PROJECT, false);
+      SnapshotDto snapshot = createSnapshot(Uuids.create(), subView, path, Qualifiers.SUBVIEW, Scopes.PROJECT, false);
       updateSnapshotPeriods(snapshot);
       commonForAnyVisit(subView, path, snapshot);
     }
 
     @Override
     public void visitProjectView(Component projectView, Path<SnapshotDtoHolder> path) {
-      SnapshotDto snapshot = createSnapshot(projectView, path, Qualifiers.PROJECT, Scopes.FILE, false);
+      SnapshotDto snapshot = createSnapshot(Uuids.create(), projectView, path, Qualifiers.PROJECT, Scopes.FILE, false);
       updateSnapshotPeriods(snapshot);
       commonForAnyVisit(projectView, path, snapshot);
     }
@@ -155,10 +156,11 @@ public class PersistSnapshotsStep implements ComputationStep {
       }
     }
 
-    private SnapshotDto createSnapshot(Component component, Path<SnapshotDtoHolder> path,
+    private SnapshotDto createSnapshot(String snapshotUuid, Component component, Path<SnapshotDtoHolder> path,
       String qualifier, String scope, boolean setVersion) {
       String componentUuid = component.getUuid();
       SnapshotDto snapshotDto = new SnapshotDto()
+        .setUuid(snapshotUuid)
         .setRootComponentUuid(rootUuid)
         .setVersion(setVersion ? component.getReportAttributes().getVersion() : null)
         .setComponentUuid(componentUuid)
index fc066ff22f3590210bb2e7035ce8679e674de4a6..fa6c1a570bca1beac5b46ac1c5dad21bc58dc3d9 100644 (file)
@@ -38,6 +38,7 @@ public class ReportComputationSteps extends AbstractComputationSteps {
   private static final List<Class<? extends ComputationStep>> STEPS = Arrays.asList(
     ExtractReportStep.class,
     LogScannerContextStep.class,
+    GenerateAnalysisUuid.class,
 
     // Builds Component tree
     LoadReportAnalysisMetadataHolderStep.class,
index ae79537f57ea05e400fe8d997fc6dfd90879eb3d..c87cf4bcc4ab3c4ca783e883a94cb3d10e2e0e2a 100644 (file)
@@ -31,19 +31,34 @@ import org.sonar.server.computation.util.InitializedProperty;
 import static com.google.common.base.Preconditions.checkNotNull;
 import static com.google.common.base.Preconditions.checkState;
 
-public class AnalysisMetadataHolderRule extends ExternalResource implements AnalysisMetadataHolder {
+public class AnalysisMetadataHolderRule extends ExternalResource implements MutableAnalysisMetadataHolder {
 
-  private InitializedProperty<Long> analysisDate = new InitializedProperty<>();
+  private final InitializedProperty<String> uuid = new InitializedProperty<>();
 
-  private InitializedProperty<Snapshot> baseProjectSnapshot = new InitializedProperty<>();
+  private final InitializedProperty<Long> analysisDate = new InitializedProperty<>();
 
-  private InitializedProperty<Boolean> crossProjectDuplicationEnabled = new InitializedProperty<>();
+  private final InitializedProperty<Snapshot> baseProjectSnapshot = new InitializedProperty<>();
 
-  private InitializedProperty<String> branch = new InitializedProperty<>();
+  private final InitializedProperty<Boolean> crossProjectDuplicationEnabled = new InitializedProperty<>();
 
-  private InitializedProperty<Integer> rootComponentRef = new InitializedProperty<>();
+  private final InitializedProperty<String> branch = new InitializedProperty<>();
 
-  private InitializedProperty<Map<String, QualityProfile>> qProfilesPerLanguage = new InitializedProperty<>();
+  private final InitializedProperty<Integer> rootComponentRef = new InitializedProperty<>();
+
+  private final InitializedProperty<Map<String, QualityProfile>> qProfilesPerLanguage = new InitializedProperty<>();
+
+  @Override
+  public String getUuid() {
+    checkState(uuid.isInitialized(), "Analysis UUID has not been set");
+    return this.uuid.getProperty();
+  }
+
+  @Override
+  public AnalysisMetadataHolderRule setUuid(String s) {
+    checkNotNull(s, "UUID must not be null");
+    this.uuid.setProperty(s);
+    return this;
+  }
 
   public AnalysisMetadataHolderRule setAnalysisDate(Date date) {
     checkNotNull(date, "Date must not be null");
@@ -51,6 +66,7 @@ public class AnalysisMetadataHolderRule extends ExternalResource implements Anal
     return this;
   }
 
+  @Override
   public AnalysisMetadataHolderRule setAnalysisDate(long date) {
     checkNotNull(date, "Date must not be null");
     this.analysisDate.setProperty(date);
@@ -68,6 +84,7 @@ public class AnalysisMetadataHolderRule extends ExternalResource implements Anal
     return getBaseProjectSnapshot() == null;
   }
 
+  @Override
   public AnalysisMetadataHolderRule setBaseProjectSnapshot(@Nullable Snapshot baseProjectSnapshot) {
     this.baseProjectSnapshot.setProperty(baseProjectSnapshot);
     return this;
@@ -80,6 +97,7 @@ public class AnalysisMetadataHolderRule extends ExternalResource implements Anal
     return baseProjectSnapshot.getProperty();
   }
 
+  @Override
   public AnalysisMetadataHolderRule setCrossProjectDuplicationEnabled(boolean isCrossProjectDuplicationEnabled) {
     this.crossProjectDuplicationEnabled.setProperty(isCrossProjectDuplicationEnabled);
     return this;
@@ -91,6 +109,7 @@ public class AnalysisMetadataHolderRule extends ExternalResource implements Anal
     return crossProjectDuplicationEnabled.getProperty();
   }
 
+  @Override
   public AnalysisMetadataHolderRule setBranch(@Nullable String branch) {
     this.branch.setProperty(branch);
     return this;
@@ -102,6 +121,7 @@ public class AnalysisMetadataHolderRule extends ExternalResource implements Anal
     return branch.getProperty();
   }
 
+  @Override
   public AnalysisMetadataHolderRule setRootComponentRef(int rootComponentRef) {
     this.rootComponentRef.setProperty(rootComponentRef);
     return this;
@@ -113,6 +133,7 @@ public class AnalysisMetadataHolderRule extends ExternalResource implements Anal
     return rootComponentRef.getProperty();
   }
 
+  @Override
   public AnalysisMetadataHolderRule setQProfilesByLanguage(Map<String, QualityProfile> qProfilesPerLanguage) {
     this.qProfilesPerLanguage.setProperty(qProfilesPerLanguage);
     return this;
index bc187d8469c40cf0363cfe10244c9f38f433a278..065eed1bd81fcd7e6c7c64f8ae611f58cb7624d0 100644 (file)
@@ -35,6 +35,16 @@ public class MutableAnalysisMetadataHolderRule extends ExternalResource implemen
     delegate = new AnalysisMetadataHolderImpl();
   }
 
+  @Override
+  public String getUuid() {
+    return delegate.getUuid();
+  }
+
+  public MutableAnalysisMetadataHolderRule setUuid(String s) {
+    delegate.setUuid(s);
+    return this;
+  }
+
   @Override
   public long getAnalysisDate() {
     return delegate.getAnalysisDate();
index 9517ebb13904507c77d6001e46507890c66270b9..fe52addb475b9bc72a76a3a7c1f181c04a544871 100644 (file)
@@ -51,6 +51,7 @@ import static org.sonar.core.config.CorePropertyDefinitions.TIMEMACHINE_MODE_PRE
 public class ReportPersistSnapshotsStepTest extends BaseStepTest {
 
   private static final String PROJECT_KEY = "PROJECT_KEY";
+  private static final String ANALYSIS_UUID = "U1";
 
   @Rule
   public DbTester dbTester = DbTester.create(System2.INSTANCE);
@@ -76,6 +77,7 @@ public class ReportPersistSnapshotsStepTest extends BaseStepTest {
   @Before
   public void setup() {
     analysisDate = DateUtils.parseDateQuietly("2015-06-01").getTime();
+    analysisMetadataHolder.setUuid(ANALYSIS_UUID);
     analysisMetadataHolder.setAnalysisDate(analysisDate);
     dbIdsRepository = new DbIdsRepositoryImpl();
 
index 26f66cad5b69d86c328c577710855134c7534b26..9d1cc1bd61c81f86262b047bef8a87c1b8ad111c 100644 (file)
@@ -55,6 +55,7 @@ import static org.sonar.server.computation.component.ComponentFunctions.toKey;
 public class ViewsPersistSnapshotsStepTest extends BaseStepTest {
 
   private static final int PROJECT_KEY = 1;
+  private static final String ANALYSIS_UUID = "U1";
 
   @Rule
   public DbTester dbTester = DbTester.create(System2.INSTANCE);
@@ -83,6 +84,7 @@ public class ViewsPersistSnapshotsStepTest extends BaseStepTest {
   @Before
   public void setup() {
     analysisDate = DateUtils.parseDateQuietly("2015-06-01").getTime();
+    analysisMetadataHolder.setUuid(ANALYSIS_UUID);
     analysisMetadataHolder.setAnalysisDate(analysisDate);
 
     now = DateUtils.parseDateQuietly("2015-06-02").getTime();
index e9e9f3fe16052a8301841a50f584add2b1fa0ad6..4a8d382e41b34f214b679b90c84705b27ac7fba0 100644 (file)
@@ -147,8 +147,15 @@ public class ComponentNavigationActionTest {
     ComponentDto project = ComponentTesting.newProjectDto("abcd")
       .setKey("polop").setName("Polop");
     dbClient.componentDao().insert(dbTester.getSession(), project);
-    dbClient.snapshotDao().insert(dbTester.getSession(), new SnapshotDto().setCreatedAt(snapshotDate.getTime()).setVersion("3.14")
-      .setLast(true).setQualifier(project.qualifier()).setComponentUuid(project.uuid()).setRootComponentUuid(project.uuid()).setScope(project.scope()));
+    dbClient.snapshotDao().insert(dbTester.getSession(), new SnapshotDto()
+      .setUuid("u1")
+      .setCreatedAt(snapshotDate.getTime())
+      .setVersion("3.14")
+      .setLast(true)
+      .setQualifier(project.qualifier())
+      .setComponentUuid(project.uuid())
+      .setRootComponentUuid(project.uuid())
+      .setScope(project.scope()));
     dbTester.getSession().commit();
 
     userSessionRule.login("obiwan").setUserId(userId).addProjectUuidPermissions(UserRole.USER, "abcd");
index 2ac38c2fb0b256cef000b1b5219a9e05eb5c8ad5..3e4fda901370429e062d2b1fa139bab4181f633e 100644 (file)
@@ -1,7 +1,9 @@
 <dataset>
   <projects id="10" kee="P1" qualifier="TRK" uuid="ABCD" name="Project 1"/>
   <snapshots
-      id="110" project_id="10" parent_snapshot_id="[null]" root_project_id="10" root_snapshot_id="[null]"
+      id="110"
+      uuid="u110"
+      project_id="10" parent_snapshot_id="[null]" root_project_id="10" root_snapshot_id="[null]"
       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]"
index 9c4b40ca2939c8e3e8468cc7a18eec3dbe89b15d..6b25fb48b9068e3d2a2e59b113d00189e8d6e153 100644 (file)
@@ -1,7 +1,11 @@
 <dataset>
-    <projects id="567" uuid="uuid_1" root_uuid="uuid_1" kee="file cpt key" enabled="[true]"/>
-    <snapshots id="123" component_uuid="uuid_1" root_component_uuid="uuid_1" islast="[true]"/>
-    <snapshots id="369" component_uuid="uuid_1" root_component_uuid="uuid_1" islast="[false]"/>
-    <metrics id="1" name="metric 1"  />
-    <metrics id="2" name="metric 2" />
+  <projects id="567" uuid="uuid_1" root_uuid="uuid_1" kee="file cpt key" enabled="[true]"/>
+  <snapshots id="123"
+             uuid="u123"
+             component_uuid="uuid_1" root_component_uuid="uuid_1" islast="[true]"/>
+  <snapshots id="369"
+             uuid="u369"
+             component_uuid="uuid_1" root_component_uuid="uuid_1" islast="[false]"/>
+  <metrics id="1" name="metric 1"/>
+  <metrics id="2" name="metric 2"/>
 </dataset>
index b89e3fcd691344b004c849fdcd8bd27a2418f9df..cbe40829665eec62676298ea999117ffcbaccad4 100644 (file)
             enabled="true"/>
 
   <!-- snapshots -->
-  <snapshots id="1000" project_id="1" root_project_id="1" root_snapshot_id="[null]"
+  <snapshots id="1000"
+             uuid="u1000"
+             project_id="1" root_project_id="1" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="1225544280000" build_date="1225544280000"
              status="P" islast="false"/>
-  <snapshots id="1001" project_id="2" root_project_id="1" root_snapshot_id="1000"
+  <snapshots id="1001"
+             uuid="u1001"
+             project_id="2" root_project_id="1" root_snapshot_id="1000"
              scope="DIR" qualifier="PAC" created_at="1225544280000" build_date="1225544280000"
              status="P" islast="false"/>
 
index b984a948a3760b2c5059480154907084b2b0d04c..ee0040b86c3cbd032185ff927c6576aa8921cab5 100644 (file)
@@ -4,7 +4,9 @@
 
   <!-- 2008-11-11 -->
   <!-- Version 0.9 -->
-  <snapshots id="1000" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1000"
+             uuid="u1000"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
@@ -13,7 +15,9 @@
 
   <!-- 2008-11-12 -->
   <!-- Version 1.0 -->
-  <snapshots id="1001" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1001"
+             uuid="u1001"
+             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]" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="1226494680000" build_date="1226494680000" version="1.0" path=""
@@ -21,7 +25,9 @@
 
   <!-- 2008-11-20 -->
   <!-- First version 1.1 -->
-  <snapshots id="1002" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1002"
+             uuid="u1002"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
@@ -29,7 +35,9 @@
              status="P" islast="[false]" depth="0"/>
 
   <!-- 2008-11-22 -->
-  <snapshots id="1003" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1003"
+             uuid="u1003"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
@@ -38,7 +46,9 @@
 
   <!-- 2008-11-29 -->
   <!-- Last version 1.1 -->
-  <snapshots id="1004" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1004"
+             uuid="u1004"
+             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]" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="1227934800000" build_date="1227934800000" version="1.1" path=""
index 4008dbdd93d092abf45f0077bb1f11633e45e129..b623941536535ae288219c79642a6cd34f9b80a4 100644 (file)
@@ -4,7 +4,9 @@
 
   <!-- 2008-11-11 -->
   <!-- Version 0.9 -->
-  <snapshots id="1000" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1000"
+             uuid="u1000"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
@@ -13,7 +15,9 @@
 
   <!-- 2008-11-12 -->
   <!-- Version 1.0 -->
-  <snapshots id="1001" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1001"
+             uuid="u1001"
+             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]" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="1226494680000" build_date="1226494680000" version="1.0" path=""
@@ -21,7 +25,9 @@
 
   <!-- 2008-11-20 -->
   <!-- version 1.1 -->
-  <snapshots id="1002" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1002"
+             uuid="u1002"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
index 7f56e78960793e579ba14646a6a050e5d20895ad..3b718bf98101b83cdf46b3c4d15dcb40a2695213 100644 (file)
@@ -4,7 +4,9 @@
 
   <!-- 2008-11-11 -->
   <!-- Version 0.9 -->
-  <snapshots id="1000" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
+  <snapshots id="1000"
+             uuid="u1000"
+             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]"
index 6f93823e528e45af447a0cd40b30afbabf35ce1f..0484c25b2b76ec5248d787ca9a989ab2877d4e57 100644 (file)
@@ -4,7 +4,9 @@
 
   <!-- 2008-11-11 -->
   <!-- Version 0.9 -->
-  <snapshots id="1000" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1000"
+             uuid="u1000"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
@@ -13,7 +15,9 @@
 
   <!-- 2008-11-12 -->
   <!-- Version 1.0 -->
-  <snapshots id="1001" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1001"
+             uuid="u1001"
+             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]" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="1226494680000" build_date="1226494680000" version="1.0" path=""
@@ -21,7 +25,9 @@
 
   <!-- 2008-11-20 -->
   <!-- First version 1.1 -->
-  <snapshots id="1002" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1002"
+             uuid="u1002"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
@@ -29,7 +35,9 @@
              status="P" islast="[false]" depth="0"/>
 
   <!-- 2008-11-22 -->
-  <snapshots id="1003" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1003"
+             uuid="u1003"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
@@ -38,7 +46,9 @@
 
   <!-- 2008-11-29 -->
   <!-- Last version 1.1 -->
-  <snapshots id="1004" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1004"
+             uuid="u1004"
+             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]" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="1227934800000" build_date="1227934800000" version="1.1" path=""
index 33c2443b3c726b160c2bfac8df7b933a81a2cb6b..75bb4dd7815eae069ef282c44310ea216627051c 100644 (file)
@@ -5,7 +5,9 @@
             enabled="[true]" language="java" />
 
   <!-- Unprocessed snapshot -->
-  <snapshots id="1000" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1000"
+             uuid="u1000"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
index e8d30bcb7dd3d847c05df7218f362b8ff59ec769..6b09a5ef43b752d5c2dec7fa72dd566803a9417d 100644 (file)
@@ -1,7 +1,9 @@
 <dataset>
 
   <!-- NEW SNAPSHOT -->
-  <snapshots id="1" component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -10,7 +12,9 @@
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="PRJ" qualifier="PAC" created_at="1228258800000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="2" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -19,7 +23,9 @@
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228258800000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="3" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -29,7 +35,9 @@
              depth="1" scope="DIR" qualifier="PAC" created_at="1228258800000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- PROJECT_ID = 3 - no last snapshot -->
-  <snapshots id="4" component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -39,7 +47,9 @@
              depth="1" scope="DIR" qualifier="PAC" created_at="1228258800000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- Child of snapshot id=1 -->
-  <snapshots id="5" component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
+  <snapshots id="5"
+             uuid="u5"
+             component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -50,7 +60,9 @@
              version="2.1-SNAPSHOT" path="1.2."/>
 
   <!-- LAST FLAGGED SNAPSHOT -->
-  <snapshots id="21" component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
+  <snapshots id="21"
+             uuid="u21"
+             component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -59,7 +71,9 @@
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="PRJ" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="22" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
+  <snapshots id="22"
+             uuid="u22"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -68,7 +82,9 @@
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="23" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
+  <snapshots id="23"
+             uuid="u23"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -78,7 +94,9 @@
              depth="1" scope="DIR" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- PROJECT_ID = 3 - no last snapshot -->
-  <snapshots id="24" component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
+  <snapshots id="24"
+             uuid="u24"
+             component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- Child of snapshot id=1 -->
-  <snapshots id="25" component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
+  <snapshots id="25"
+             uuid="u25"
+             component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              version="2.1-SNAPSHOT" path="1.2."/>
 
   <!-- OLD SNAPSHOT -->
-  <snapshots id="46" component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
+  <snapshots id="46"
+             uuid="u46"
+             component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="PRJ" qualifier="PAC" created_at="1228086000000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="47" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
+  <snapshots id="47"
+             uuid="u47"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228086000000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="48" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
+  <snapshots id="48"
+             uuid="u48"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228086000000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- PROJECT_ID = 3 - no last snapshot -->
-  <snapshots id="49" component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
+  <snapshots id="49"
+             uuid="u49"
+             component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228086000000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- Child of snapshot id=1 -->
-  <snapshots id="50" component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
+  <snapshots id="50"
+             uuid="u50"
+             component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
index 662f5a5806a5fe55818cfe50481d25ba42e3fe46..c4604b587f114e77dce8debb93ce205e9f2ca6d0 100644 (file)
@@ -1,7 +1,9 @@
 <dataset>
 
   <!-- NEW SNAPSHOT -->
-  <snapshots id="1" component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
              status="U" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -10,7 +12,9 @@
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="PRJ" qualifier="PAC" created_at="1228258800000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="2" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
              status="U" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -19,7 +23,9 @@
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228258800000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="3" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
              status="U" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -29,7 +35,9 @@
              depth="1" scope="DIR" qualifier="PAC" created_at="1228258800000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- PROJECT_ID = 3 - no last snapshot -->
-  <snapshots id="4" component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
              status="U" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -39,7 +47,9 @@
              depth="1" scope="DIR" qualifier="PAC" created_at="1228258800000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- Child of snapshot id=1 -->
-  <snapshots id="5" component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
+  <snapshots id="5"
+             uuid="u5"
+             component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="1"
              status="U" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -50,7 +60,9 @@
              version="2.1-SNAPSHOT" path="1.2."/>
 
   <!-- LAST FLAGGED SNAPSHOT -->
-  <snapshots id="21" component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
+  <snapshots id="21"
+             uuid="u21"
+             component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -59,7 +71,9 @@
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="PRJ" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="22" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
+  <snapshots id="22"
+             uuid="u22"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -68,7 +82,9 @@
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="23" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
+  <snapshots id="23"
+             uuid="u23"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -78,7 +94,9 @@
              depth="1" scope="DIR" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- PROJECT_ID = 3 - no last snapshot -->
-  <snapshots id="24" component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
+  <snapshots id="24"
+             uuid="u24"
+             component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- Child of snapshot id=1 -->
-  <snapshots id="25" component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
+  <snapshots id="25"
+             uuid="u25"
+             component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="21"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              version="2.1-SNAPSHOT" path="1.2."/>
 
   <!-- OLD SNAPSHOT -->
-  <snapshots id="46" component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
+  <snapshots id="46"
+             uuid="u46"
+             component_uuid="uuid_123" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="PRJ" qualifier="PAC" created_at="1228086000000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="47" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
+  <snapshots id="47"
+             uuid="u47"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228086000000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="48" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
+  <snapshots id="48"
+             uuid="u48"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228086000000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- PROJECT_ID = 3 - no last snapshot -->
-  <snapshots id="49" component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
+  <snapshots id="49"
+             uuid="u49"
+             component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228086000000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- Child of snapshot id=1 -->
-  <snapshots id="50" component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
+  <snapshots id="50"
+             uuid="u50"
+             component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_123" root_snapshot_id="46"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
index 8c199a80d8b22a251912de7f6cd32b03d1d36a26..ede097715d1217eb85358b98eef66cd26337ca9f 100644 (file)
 
 
   <!-- snapshots -->
-  <snapshots 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]" id="1" created_at="1230163200000" build_date="1230163200000" version="1.0" project_id="1" scope="PRJ" qualifier="TRK"
+  <snapshots 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]"
+             id="1"
+             uuid="u1"
+             created_at="1230163200000" build_date="1230163200000" version="1.0" project_id="1" scope="PRJ" qualifier="TRK"
              root_project_id="1" root_snapshot_id="[null]" parent_snapshot_id="[null]" STATUS="P" ISLAST="true"
              path=""
              depth="0"/>
 
-  <snapshots 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]" id="2" created_at="1230163201000" build_date="1230163201000" version="1.0" project_id="3" scope="PRJ" qualifier="VW"
+  <snapshots 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]"
+             id="2"
+             uuid="u2"
+             created_at="1230163201000" build_date="1230163201000" version="1.0" project_id="3" scope="PRJ" qualifier="VW"
              root_project_id="2" root_snapshot_id="[null]" parent_snapshot_id="[null]" STATUS="P" ISLAST="true"
              path=""
              depth="0"/>
 
-  <snapshots 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]" id="3" created_at="1230163201000" build_date="1230163201000" version="1.0" project_id="3" scope="PRJ" qualifier="SVW"
+  <snapshots 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]"
+             id="3"
+             uuid="u3"
+             created_at="1230163201000" build_date="1230163201000" version="1.0" project_id="3" scope="PRJ" qualifier="SVW"
              root_project_id="2" root_snapshot_id="2" parent_snapshot_id="2" STATUS="P" ISLAST="true"
              path="2."
              depth="1"/>
 
-  <snapshots 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]" id="4" created_at="1230163200000" build_date="1230163200000" version="1.0" project_id="4" scope="FIL" qualifier="TRK"
+  <snapshots 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]"
+             id="4"
+             uuid="u4"
+             created_at="1230163200000" build_date="1230163200000" version="1.0" project_id="4" scope="FIL" qualifier="TRK"
              root_project_id="2" root_snapshot_id="2" parent_snapshot_id="3" STATUS="P" ISLAST="true"
              path="2.3."
              depth="2"/>
index ab190db883e9f205cb1e462b7c4614829bd171b9..60d27b9ae4b28fa3b901d9eaefa359084d9ffc15 100644 (file)
@@ -1,7 +1,11 @@
 <dataset>
   <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="ABCD" root_uuid="ABCD"/>
-  <snapshots id="10" component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]"/>
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]"/>
 
   <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="BCDE" root_uuid="ABCD"/>
-  <snapshots id="100" component_uuid="BCDE" root_component_uuid="ABCD" islast="[true]"/>
+  <snapshots id="100"
+             uuid="u100"
+             component_uuid="BCDE" root_component_uuid="ABCD" islast="[true]"/>
 </dataset>
index a1508445b14f9b6a6ad0157173b5b5fcb7f00832..a8b95ef4769aad29bb8cb3b2e6092b1ecf269aaa 100644 (file)
@@ -2,6 +2,10 @@
   <projects id="1" kee="struts" root_uuid="ABCD" uuid="ABCD"/>
   <projects id="2" kee="struts:Action.java" root_uuid="ABCD" uuid="BCDE"/>
 
-  <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" islast="[true]" />
-  <snapshots id="2" component_uuid="BCDE" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" />
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" islast="[true]" />
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="BCDE" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" />
 </dataset>
index ab190db883e9f205cb1e462b7c4614829bd171b9..60d27b9ae4b28fa3b901d9eaefa359084d9ffc15 100644 (file)
@@ -1,7 +1,11 @@
 <dataset>
   <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="ABCD" root_uuid="ABCD"/>
-  <snapshots id="10" component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]"/>
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]"/>
 
   <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="BCDE" root_uuid="ABCD"/>
-  <snapshots id="100" component_uuid="BCDE" root_component_uuid="ABCD" islast="[true]"/>
+  <snapshots id="100"
+             uuid="u100"
+             component_uuid="BCDE" root_component_uuid="ABCD" islast="[true]"/>
 </dataset>
index 918d755636adef6bc27a8f6662a23a381937ed71..fb18192c21605a2898bf801cdd43f9b6b5c527a2 100644 (file)
@@ -1,10 +1,14 @@
 <dataset>
 
   <projects id="10" scope="PRJ" qualifier="TRK" kee="struts" name="Struts" uuid="ABCD" root_uuid="ABCD"/>
-  <snapshots id="10" component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]"/>
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]"/>
 
   <projects id="100" scope="FIL" qualifier="CLA" kee="struts:Action" name="Action" uuid="BCDE" root_uuid="ABCD"/>
-  <snapshots id="100" component_uuid="BCDE" root_component_uuid="ABCD" islast="[true]"/>
+  <snapshots id="100"
+             uuid="u100"
+             component_uuid="BCDE" root_component_uuid="ABCD" islast="[true]"/>
 
   <issues id="1"
           kee="ABCDE"
index f51f08eef2e620372cc950c033f843cee511a29a..354308dbda234584d79cb4a4b43cb56d45f02220 100644 (file)
@@ -22,7 +22,9 @@
             description="[null]" enabled="[true]" language="java" 
             created_at="2008-12-19 00:00:00.00"/>
 
-  <snapshots id="101" component_uuid="ABCD" root_component_uuid="ABCD" root_snapshot_id="[null]" parent_snapshot_id="[null]"
+  <snapshots id="101"
+             uuid="u101"
+             component_uuid="ABCD" root_component_uuid="ABCD" root_snapshot_id="[null]" parent_snapshot_id="[null]"
              scope="FIL" qualifier="CLA" path="" depth="0"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]"
@@ -31,7 +33,9 @@
              created_at="1229727600000" build_date="1229727600000"
              version="1.0" status="P" islast="[true]"/>
 
-  <snapshots id="102" component_uuid="BCDE" root_component_uuid="ABCD" root_snapshot_id="101" parent_snapshot_id="101"
+  <snapshots id="102"
+             uuid="u102"
+             component_uuid="BCDE" root_component_uuid="ABCD" root_snapshot_id="101" parent_snapshot_id="101"
              scope="FIL" qualifier="CLA" path="101." depth="1"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]"
@@ -40,7 +44,9 @@
              created_at="1229727600000" build_date="1229727600000"
              version="1.0" status="P" islast="[true]"/>
 
-  <snapshots id="103" component_uuid="CDEF" root_component_uuid="ABCD" root_snapshot_id="101" parent_snapshot_id="102"
+  <snapshots id="103"
+             uuid="u103"
+             component_uuid="CDEF" root_component_uuid="ABCD" root_snapshot_id="101" parent_snapshot_id="102"
              scope="FIL" qualifier="CLA" path="101.102." depth="2"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]"
@@ -49,7 +55,9 @@
              created_at="1229727600000" build_date="1229727600000"
              version="1.0" status="P" islast="[true]"/>
 
-  <snapshots id="104" component_uuid="DEFG" root_component_uuid="ABCD" root_snapshot_id="101" parent_snapshot_id="102"
+  <snapshots id="104"
+             uuid="u104"
+             component_uuid="DEFG" root_component_uuid="ABCD" root_snapshot_id="101" parent_snapshot_id="102"
              scope="FIL" qualifier="CLA" path="101.102." depth="2"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]"
index 99a098986c34bf3d3cc440052e7a085c21d38645..a1159c552a610d7b6cf9cd18ed313c300dff9de1 100644 (file)
@@ -8,7 +8,9 @@
             id="1" root_uuid="UUID_JAVA_PROJECT" uuid="UUID_JAVA_PROJECT"
             description="[null]" enabled="[true]" language="[null]" />
 
-  <snapshots id="101" component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT"
+  <snapshots id="101"
+             uuid="u101"
+             component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT"
              root_snapshot_id="[null]" parent_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" path="" depth="0"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index f0ccad26c0995cb01f962100588c39bdc76bfc7f..073b7c09d6ada4fd12e425f7d653a55e1012ff02 100644 (file)
@@ -8,7 +8,9 @@
             id="1" root_uuid="UUID_JAVA_PROJECT" uuid="UUID_JAVA_PROJECT"
             description="[null]" enabled="[true]" language="[null]"/>
 
-  <snapshots id="101" component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT"
+  <snapshots id="101"
+             uuid="u101"
+             component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT"
              root_snapshot_id="[null]" parent_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" path="" depth="0"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 0cbb579a2541f65e013e79f5c667205d79f5879b..c9b4a48a8bf5b377934a8b4dd8ce6baab095f951 100644 (file)
@@ -44,7 +44,9 @@
             description="[null]" enabled="[true]" language="java" 
             created_at="2008-12-19 00:00:00.00"/>
 
-  <snapshots id="101" component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT"
+  <snapshots id="101"
+             uuid="u101"
+             component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT"
              root_snapshot_id="[null]" parent_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" path="" depth="0"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -54,7 +56,9 @@
              created_at="1229727600000" build_date="1229727600000"
              version="1.0" status="P" islast="[true]"/>
 
-  <snapshots id="102" component_uuid="BCDE" root_component_uuid="UUID_JAVA_PROJECT" root_snapshot_id="101"
+  <snapshots id="102"
+             uuid="u102"
+             component_uuid="BCDE" root_component_uuid="UUID_JAVA_PROJECT" root_snapshot_id="101"
              parent_snapshot_id="101"
              scope="DIR" qualifier="PAC" path="101." depth="1"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -64,7 +68,9 @@
              created_at="1229727600000" build_date="1229727600000"
              version="1.0" status="P" islast="[true]"/>
 
-  <snapshots id="103" component_uuid="CDEF" root_component_uuid="UUID_JAVA_PROJECT" root_snapshot_id="101"
+  <snapshots id="103"
+             uuid="u103"
+             component_uuid="CDEF" root_component_uuid="UUID_JAVA_PROJECT" root_snapshot_id="101"
              parent_snapshot_id="102"
              scope="FIL" qualifier="CLA" path="101.102." depth="2"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -74,7 +80,9 @@
              created_at="1229727600000" build_date="1229727600000"
              version="1.0" status="P" islast="[true]"/>
 
-  <snapshots id="104" component_uuid="DEFG" root_component_uuid="UUID_JAVA_PROJECT" root_snapshot_id="101"
+  <snapshots id="104"
+             uuid="u104"
+             component_uuid="DEFG" root_component_uuid="UUID_JAVA_PROJECT" root_snapshot_id="101"
              parent_snapshot_id="102"
              scope="FIL" qualifier="CLA" path="101.102." depth="2"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
             created_at="2012-12-12 04:06:00.00"/>
 
 
-  <snapshots id="110" component_uuid="UUID_PHP_PROJECT" root_component_uuid="UUID_PHP_PROJECT" root_snapshot_id="[null]"
+  <snapshots id="110"
+             uuid="u110"
+             component_uuid="UUID_PHP_PROJECT" root_component_uuid="UUID_PHP_PROJECT" root_snapshot_id="[null]"
              parent_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" path="" depth="0"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 32941aa476c8bb808f02691d160457522a5ae319..95b9e0a203a966f5ef91c2ad89508e86e1e00afd 100644 (file)
@@ -11,7 +11,9 @@
             description="[null]" enabled="[true]" language="[null]"
             created_at="2008-12-19 00:00:00.00"/>
 
-  <snapshots id="101" component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT"
+  <snapshots id="101"
+             uuid="u101"
+             component_uuid="UUID_JAVA_PROJECT" root_component_uuid="UUID_JAVA_PROJECT"
              root_snapshot_id="[null]" parent_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" path="" depth="0"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -38,7 +40,9 @@
             created_at="2012-12-12 04:06:00.00"/>
 
 
-  <snapshots id="110" component_uuid="UUID_PHP_PROJECT" root_component_uuid="UUID_PHP_PROJECT" root_snapshot_id="[null]"
+  <snapshots id="110"
+             uuid="u110"
+             component_uuid="UUID_PHP_PROJECT" root_component_uuid="UUID_PHP_PROJECT" root_snapshot_id="[null]"
              parent_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" path="" depth="0"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -64,7 +68,9 @@
             created_at="2012-12-12 04:06:00.00"/>
 
 
-  <snapshots id="120" component_uuid="CDEF" root_component_uuid="CDEF" root_snapshot_id="[null]" parent_snapshot_id="[null]"
+  <snapshots id="120"
+             uuid="u120"
+             component_uuid="CDEF" root_component_uuid="CDEF" root_snapshot_id="[null]" parent_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" path="" depth="0"
              purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]" period3_mode="[null]"
index 5ceeba2fceeb18c8eba3d4b78d28d67ffa2b6ce1..1d538bfc0b95472da8269cd34da84eed860dcd0e 100644 (file)
@@ -4,7 +4,9 @@
             uuid="JKLM" root_uuid="JKLM" project_uuid="JKLM" module_uuid="[null]" module_uuid_path="."
             enabled="[true]" path="[null]"/>
 
-  <snapshots id="100" component_uuid="JKLM" parent_snapshot_id="[null]" root_component_uuid="JKLM" root_snapshot_id="[null]"
+  <snapshots id="100"
+             uuid="u100"
+             component_uuid="JKLM" parent_snapshot_id="[null]" root_component_uuid="JKLM" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" version="[null]" path=""/>
 
index d96e1157ea06885d52754d7074d0466f49936436..0683f90d6b6bdb3dc35ff2bb5063525928cb200e 100644 (file)
@@ -3,14 +3,18 @@
   <!-- Simple View -->
   <projects id="10" uuid="ABCD" root_uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="." copy_component_uuid="[null]" enabled="[true]"
             kee="MASTER_PROJECT" scope="PRJ" qualifier="VW" name="All projects" path="[null]"/>
-  <snapshots id="10" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              depth="[null]" scope="PRJ" qualifier="VW" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
 
   <projects id="110" uuid="BCDE" root_uuid="ABCD" project_uuid="ABCD" module_uuid="ABCD" module_uuid_path=".ABCD." copy_component_uuid="JKLM" enabled="[true]"
             kee="MASTER_PROJECTorg.struts:struts" scope="FIL" qualifier="TRK" name="Struts" path="[null]"/>
-  <snapshots id="110" component_uuid="BCDE" parent_snapshot_id="[null]" root_component_uuid="BCDE" root_snapshot_id="[null]"
+  <snapshots id="110"
+             uuid="u110"
+             component_uuid="BCDE" parent_snapshot_id="[null]" root_component_uuid="BCDE" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
   <!-- View with sub view -->
   <projects id="11" uuid="EFGH" root_uuid="EFGH" project_uuid="EFGH" module_uuid="[null]" module_uuid_path="." copy_component_uuid="[null]" enabled="[true]"
             kee="LANGUAGE_VIEW" scope="PRJ" qualifier="VW" name="By Language" path="[null]"/>
-  <snapshots id="11" component_uuid="EFGH" parent_snapshot_id="[null]" root_component_uuid="EFGH" root_snapshot_id="[null]"
+  <snapshots id="11"
+             uuid="u11"
+             component_uuid="EFGH" parent_snapshot_id="[null]" root_component_uuid="EFGH" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              depth="[null]" scope="PRJ" qualifier="VW" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
   <projects id="112" uuid="GHIJ" root_uuid="EFGH" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_component_uuid="KLMN" enabled="[true]"
             kee="VIEW2org.elasticsearch:elasticsearch" scope="FIL" qualifier="TRK" name="SSLR" path="[null]"/>
-  <snapshots id="112" component_uuid="GHIJ" parent_snapshot_id="[null]" root_component_uuid="GHIJ" root_snapshot_id="[null]"
+  <snapshots id="112"
+             uuid="u112"
+             component_uuid="GHIJ" parent_snapshot_id="[null]" root_component_uuid="GHIJ" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
   <!-- Sub view -->
   <projects id="13" uuid="FGHI" root_uuid="EFGH" project_uuid="EFGH" module_uuid="EFGH" module_uuid_path=".EFGH." copy_component_uuid="[null]" enabled="[true]"
             kee="JAVA_PROJECTS" scope="PRJ" qualifier="SVW" name="Java projects" path="[null]"/>
-  <snapshots id="13" component_uuid="FGHI" parent_snapshot_id="[null]" root_component_uuid="FGHI" root_snapshot_id="[null]"
+  <snapshots id="13"
+             uuid="u13"
+             component_uuid="FGHI" parent_snapshot_id="[null]" root_component_uuid="FGHI" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              depth="[null]" scope="PRJ" qualifier="SVW" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
 
   <projects id="113" uuid="HIJK" root_uuid="EFGH" project_uuid="EFGH" module_uuid="FGHI" module_uuid_path=".EFGH.FGHI." copy_component_uuid="JKLM" enabled="[true]"
             kee="VIEW2org.struts:struts" scope="FIL" qualifier="TRK" name="Struts" path="[null]"/>
-  <snapshots id="113" component_uuid="HIJK" parent_snapshot_id="[null]" root_component_uuid="HIJK" root_snapshot_id="[null]"
+  <snapshots id="113"
+             uuid="u113"
+             component_uuid="HIJK" parent_snapshot_id="[null]" root_component_uuid="HIJK" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
@@ -47,7 +59,9 @@
   <!-- View without project -->
   <projects id="14" uuid="IJKL" root_uuid="IJKL" project_uuid="IJKL" module_uuid="[null]" module_uuid_path="." copy_component_uuid="[null]" enabled="[true]"
             kee="OTHER" scope="PRJ" qualifier="VW" name="Other projects" path="[null]"/>
-  <snapshots id="14" component_uuid="IJKL" parent_snapshot_id="[null]" root_component_uuid="IJKL" root_snapshot_id="[null]"
+  <snapshots id="14"
+             uuid="u14"
+             component_uuid="IJKL" parent_snapshot_id="[null]" root_component_uuid="IJKL" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              depth="[null]" scope="PRJ" qualifier="VW" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
@@ -57,7 +71,9 @@
   <projects id="100" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts"
             uuid="JKLM" root_uuid="JKLM" project_uuid="JKLM" module_uuid="[null]" module_uuid_path="."
             enabled="[true]" copy_component_uuid="[null]" path="[null]"/>
-  <snapshots id="100" component_uuid="JKLM" parent_snapshot_id="[null]" root_component_uuid="JKLM" root_snapshot_id="[null]"
+  <snapshots id="100"
+             uuid="u100"
+             component_uuid="JKLM" parent_snapshot_id="[null]" root_component_uuid="JKLM" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
@@ -65,7 +81,9 @@
   <projects id="101" scope="PRJ" qualifier="TRK" kee="org.elasticsearch:elasticsearch" name="Elasticsearch"
             uuid="KLMN" root_uuid="KLMN" project_uuid="KLMN" module_uuid="[null]" module_uuid_path="."
             enabled="[true]" copy_component_uuid="[null]" path="[null]"/>
-  <snapshots id="101" component_uuid="KLMN" parent_snapshot_id="[null]" root_component_uuid="KLMN" root_snapshot_id="[null]"
+  <snapshots id="101"
+             uuid="u101"
+             component_uuid="KLMN" parent_snapshot_id="[null]" root_component_uuid="KLMN" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1208_add_component_uuid_columns_to_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1208_add_component_uuid_columns_to_snapshots.rb
new file mode 100644 (file)
index 0000000..d79d482
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# 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 AddComponentUuidColumnsToSnapshots < ActiveRecord::Migration
+
+  def self.up
+    execute_java_migration('org.sonar.db.version.v60.AddComponentUuidColumnsToSnapshots')
+  end
+end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1208_add_uuid_columns_to_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1208_add_uuid_columns_to_snapshots.rb
deleted file mode 100644 (file)
index 5d635c1..0000000
+++ /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 AddUuidColumnsToSnapshots < ActiveRecord::Migration
-
-  def self.up
-    execute_java_migration('org.sonar.db.version.v60.AddUuidColumnsToSnapshots')
-  end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1209_populate_component_uuid_columns_of_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1209_populate_component_uuid_columns_of_snapshots.rb
new file mode 100644 (file)
index 0000000..6bd9447
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# 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 PopulateComponentUuidColumnsOfSnapshots < ActiveRecord::Migration
+
+  def self.up
+    execute_java_migration('org.sonar.db.version.v60.PopulateComponentUuidColumnsOfSnapshots')
+  end
+end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1209_populate_uuid_columns_of_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1209_populate_uuid_columns_of_snapshots.rb
deleted file mode 100644 (file)
index 6ca6a0d..0000000
+++ /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 PopulateUuidColumnsOfSnapshots < ActiveRecord::Migration
-
-  def self.up
-    execute_java_migration('org.sonar.db.version.v60.PopulateUuidColumnsOfSnapshots')
-  end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1211_make_component_uuid_columns_not_null_on_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1211_make_component_uuid_columns_not_null_on_snapshots.rb
new file mode 100644 (file)
index 0000000..29c328e
--- /dev/null
@@ -0,0 +1,32 @@
+#
+# 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 MakeComponentUuidColumnsNotNullOnSnapshots < ActiveRecord::Migration
+
+  def self.up
+    execute_java_migration('org.sonar.db.version.v60.MakeComponentUuidColumnsNotNullOnSnapshots')
+
+    add_index :snapshots, :component_uuid, :name => 'snapshot_component'
+    add_index :snapshots, :root_component_uuid, :name => 'snapshot_root_component'
+  end
+end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1211_make_uuid_columns_not_null_on_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1211_make_uuid_columns_not_null_on_snapshots.rb
deleted file mode 100644 (file)
index a214efc..0000000
+++ /dev/null
@@ -1,32 +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 MakeUuidColumnsNotNullOnSnapshots < ActiveRecord::Migration
-
-  def self.up
-    execute_java_migration('org.sonar.db.version.v60.MakeUuidColumnsNotNullOnSnapshots')
-
-    add_index :snapshots, :component_uuid, :name => 'snapshot_component'
-    add_index :snapshots, :root_component_uuid, :name => 'snapshot_root_component'
-  end
-end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1228_add_uuid_column_to_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1228_add_uuid_column_to_snapshots.rb
new file mode 100644 (file)
index 0000000..10d61c8
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# 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 AddUuidColumnToSnapshots < ActiveRecord::Migration
+
+  def self.up
+    execute_java_migration('org.sonar.db.version.v60.AddUuidColumnToSnapshots')
+  end
+end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1229_populate_uuid_column_on_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1229_populate_uuid_column_on_snapshots.rb
new file mode 100644 (file)
index 0000000..fe409fe
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# 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 PopulateUuidColumnOnSnapshots < ActiveRecord::Migration
+
+  def self.up
+    execute_java_migration('org.sonar.db.version.v60.PopulateUuidColumnOnSnapshots')
+  end
+end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1230_make_uuid_column_not_null_on_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1230_make_uuid_column_not_null_on_snapshots.rb
new file mode 100644 (file)
index 0000000..d7baeef
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# 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 MakeUuidColumnNotNullOnSnapshots < ActiveRecord::Migration
+
+  def self.up
+    execute_java_migration('org.sonar.db.version.v60.MakeUuidColumnNotNullOnSnapshots')
+  end
+end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1231_add_unique_index_on_uuid_of_snapshots.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/1231_add_unique_index_on_uuid_of_snapshots.rb
new file mode 100644 (file)
index 0000000..5a66c1d
--- /dev/null
@@ -0,0 +1,29 @@
+#
+# 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 AddUniqueIndexOnUuidOfSnapshots < ActiveRecord::Migration
+
+  def self.up
+    add_index :snapshots, :uuid, :name => 'analyses_uuid', :unique => true
+  end
+end
index a70f75b0e77b50d104eed006324ea49d95b7bbc3..21d281278c3e57349a2e06791829fbf553dede88 100644 (file)
@@ -35,6 +35,7 @@ public final class SnapshotDto {
   private Long id;
   private Long parentId;
   private Long rootId;
+  private String uuid;
 
   private String rootComponentUuid;
   private String componentUuid;
@@ -77,6 +78,15 @@ public final class SnapshotDto {
     return this;
   }
 
+  public SnapshotDto setUuid(String s) {
+    this.uuid = s;
+    return this;
+  }
+
+  public String getUuid() {
+    return this.uuid;
+  }
+
   @CheckForNull
   public Long getParentId() {
     return parentId;
index 887c87f8cfc53458055b7b14240e98f88f0a5d64..9285480a5690a73ba1c3715a3a63a790e7651267 100644 (file)
@@ -30,7 +30,7 @@ import org.sonar.db.MyBatis;
 
 public class DatabaseVersion {
 
-  public static final int LAST_VERSION = 1_227;
+  public static final int LAST_VERSION = 1_231;
 
   /**
    * The minimum supported version which can be upgraded. Lower
index 07a5e5d79f73d3d67f097c2174bb5328dc32effb..521436d159764589e980c487536894d58bb83702 100644 (file)
@@ -84,9 +84,10 @@ import org.sonar.db.version.v55.FeedRulesTypes;
 import org.sonar.db.version.v56.FixLengthOfIssuesMessageOnOracle;
 import org.sonar.db.version.v56.FixTypeOfRuleTypeOnMysql;
 import org.sonar.db.version.v60.AddComponentUuidColumnToMeasures;
+import org.sonar.db.version.v60.AddComponentUuidColumnsToSnapshots;
+import org.sonar.db.version.v60.AddUuidColumnToSnapshots;
 import org.sonar.db.version.v60.AddUuidColumnsToProjects;
 import org.sonar.db.version.v60.AddUuidColumnsToResourceIndex;
-import org.sonar.db.version.v60.AddUuidColumnsToSnapshots;
 import org.sonar.db.version.v60.CleanOrphanRowsInProjects;
 import org.sonar.db.version.v60.CleanOrphanRowsInResourceIndex;
 import org.sonar.db.version.v60.CleanOrphanRowsInSnapshots;
@@ -97,14 +98,16 @@ import org.sonar.db.version.v60.DropIdColumnsFromSnapshots;
 import org.sonar.db.version.v60.DropProjectIdColumnFromMeasures;
 import org.sonar.db.version.v60.DropRememberMeColumnsFromUsers;
 import org.sonar.db.version.v60.DropUnusedMeasuresColumns;
+import org.sonar.db.version.v60.MakeComponentUuidColumnsNotNullOnSnapshots;
 import org.sonar.db.version.v60.MakeComponentUuidNotNullOnMeasures;
+import org.sonar.db.version.v60.MakeUuidColumnNotNullOnSnapshots;
 import org.sonar.db.version.v60.MakeUuidColumnsNotNullOnProjects;
 import org.sonar.db.version.v60.MakeUuidColumnsNotNullOnResourceIndex;
-import org.sonar.db.version.v60.MakeUuidColumnsNotNullOnSnapshots;
 import org.sonar.db.version.v60.PopulateComponentUuidOfMeasures;
+import org.sonar.db.version.v60.PopulateUuidColumnOnSnapshots;
 import org.sonar.db.version.v60.PopulateUuidColumnsOfProjects;
 import org.sonar.db.version.v60.PopulateUuidColumnsOfResourceIndex;
-import org.sonar.db.version.v60.PopulateUuidColumnsOfSnapshots;
+import org.sonar.db.version.v60.PopulateComponentUuidColumnsOfSnapshots;
 
 public class MigrationStepModule extends Module {
   @Override
@@ -196,10 +199,10 @@ public class MigrationStepModule extends Module {
       MakeUuidColumnsNotNullOnResourceIndex.class,
       DropIdColumnsFromResourceIndex.class,
       DropUnusedMeasuresColumns.class,
-      AddUuidColumnsToSnapshots.class,
-      PopulateUuidColumnsOfSnapshots.class,
+      AddComponentUuidColumnsToSnapshots.class,
+      PopulateComponentUuidColumnsOfSnapshots.class,
       CleanOrphanRowsInSnapshots.class,
-      MakeUuidColumnsNotNullOnSnapshots.class,
+      MakeComponentUuidColumnsNotNullOnSnapshots.class,
       DropIdColumnsFromSnapshots.class,
       AddComponentUuidColumnToMeasures.class,
       PopulateComponentUuidOfMeasures.class,
@@ -211,6 +214,12 @@ public class MigrationStepModule extends Module {
       PopulateUuidColumnsOfProjects.class,
       CleanOrphanRowsInProjects.class,
       MakeUuidColumnsNotNullOnProjects.class,
-      DropIdColumnsFromProjects.class);
+      DropIdColumnsFromProjects.class,
+
+      // SNAPSHOTS.UUID
+      AddUuidColumnToSnapshots.class,
+      PopulateUuidColumnOnSnapshots.class,
+      MakeUuidColumnNotNullOnSnapshots.class
+    );
   }
 }
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/AddComponentUuidColumnsToSnapshots.java b/sonar-db/src/main/java/org/sonar/db/version/v60/AddComponentUuidColumnsToSnapshots.java
new file mode 100644 (file)
index 0000000..9fdfd38
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * 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 AddComponentUuidColumnsToSnapshots extends DdlChange {
+
+  private static final String TABLE_SNAPSHOTS = "snapshots";
+
+  public AddComponentUuidColumnsToSnapshots(Database db) {
+    super(db);
+  }
+
+  @Override
+  public void execute(Context context) throws SQLException {
+    context.execute(new AddColumnsBuilder(getDatabase().getDialect(), TABLE_SNAPSHOTS)
+      .addColumn(newVarcharColumnDefBuilder().setColumnName("component_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(true).build())
+      .addColumn(newVarcharColumnDefBuilder().setColumnName("root_component_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(true).build())
+      .build());
+  }
+
+}
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/AddUuidColumnToSnapshots.java b/sonar-db/src/main/java/org/sonar/db/version/v60/AddUuidColumnToSnapshots.java
new file mode 100644 (file)
index 0000000..349459b
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * 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 AddUuidColumnToSnapshots extends DdlChange {
+
+  private static final String TABLE_SNAPSHOTS = "snapshots";
+
+  public AddUuidColumnToSnapshots(Database db) {
+    super(db);
+  }
+
+  @Override
+  public void execute(Context context) throws SQLException {
+    context.execute(new AddColumnsBuilder(getDialect(), TABLE_SNAPSHOTS)
+      .addColumn(newVarcharColumnDefBuilder().setColumnName("uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(true).build())
+      .build());
+  }
+
+}
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/AddUuidColumnsToSnapshots.java b/sonar-db/src/main/java/org/sonar/db/version/v60/AddUuidColumnsToSnapshots.java
deleted file mode 100644 (file)
index a9abdc7..0000000
+++ /dev/null
@@ -1,46 +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 AddUuidColumnsToSnapshots extends DdlChange {
-
-  private static final String TABLE_SNAPSHOTS = "snapshots";
-
-  public AddUuidColumnsToSnapshots(Database db) {
-    super(db);
-  }
-
-  @Override
-  public void execute(Context context) throws SQLException {
-    context.execute(new AddColumnsBuilder(getDatabase().getDialect(), TABLE_SNAPSHOTS)
-      .addColumn(newVarcharColumnDefBuilder().setColumnName("component_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(true).build())
-      .addColumn(newVarcharColumnDefBuilder().setColumnName("root_component_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(true).build())
-      .build());
-  }
-
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/MakeComponentUuidColumnsNotNullOnSnapshots.java b/sonar-db/src/main/java/org/sonar/db/version/v60/MakeComponentUuidColumnsNotNullOnSnapshots.java
new file mode 100644 (file)
index 0000000..40c2c55
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * 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 MakeComponentUuidColumnsNotNullOnSnapshots extends DdlChange {
+
+  private static final String TABLE_SNAPSHOTS = "snapshots";
+
+  public MakeComponentUuidColumnsNotNullOnSnapshots(Database db) {
+    super(db);
+  }
+
+  @Override
+  public void execute(Context context) throws SQLException {
+    context.execute(new AlterColumnsBuilder(getDatabase().getDialect(), TABLE_SNAPSHOTS)
+      .updateColumn(newVarcharColumnDefBuilder().setColumnName("component_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(false).build())
+      .updateColumn(newVarcharColumnDefBuilder().setColumnName("root_component_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(false).build())
+      .build());
+  }
+
+}
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/MakeUuidColumnNotNullOnSnapshots.java b/sonar-db/src/main/java/org/sonar/db/version/v60/MakeUuidColumnNotNullOnSnapshots.java
new file mode 100644 (file)
index 0000000..527201a
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * 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 MakeUuidColumnNotNullOnSnapshots extends DdlChange {
+
+  private static final String TABLE_SNAPSHOTS = "snapshots";
+
+  public MakeUuidColumnNotNullOnSnapshots(Database db) {
+    super(db);
+  }
+
+  @Override
+  public void execute(Context context) throws SQLException {
+    context.execute(new AlterColumnsBuilder(getDatabase().getDialect(), TABLE_SNAPSHOTS)
+      .updateColumn(newVarcharColumnDefBuilder().setColumnName("uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(false).build())
+      .build());
+  }
+
+}
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/MakeUuidColumnsNotNullOnSnapshots.java b/sonar-db/src/main/java/org/sonar/db/version/v60/MakeUuidColumnsNotNullOnSnapshots.java
deleted file mode 100644 (file)
index c821e58..0000000
+++ /dev/null
@@ -1,46 +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 MakeUuidColumnsNotNullOnSnapshots extends DdlChange {
-
-  private static final String TABLE_SNAPSHOTS = "snapshots";
-
-  public MakeUuidColumnsNotNullOnSnapshots(Database db) {
-    super(db);
-  }
-
-  @Override
-  public void execute(Context context) throws SQLException {
-    context.execute(new AlterColumnsBuilder(getDatabase().getDialect(), TABLE_SNAPSHOTS)
-      .updateColumn(newVarcharColumnDefBuilder().setColumnName("component_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(false).build())
-      .updateColumn(newVarcharColumnDefBuilder().setColumnName("root_component_uuid").setLimit(UUID_VARCHAR_SIZE).setIsNullable(false).build())
-      .build());
-  }
-
-}
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshots.java b/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshots.java
new file mode 100644 (file)
index 0000000..36db080
--- /dev/null
@@ -0,0 +1,85 @@
+/*
+ * 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.HashMap;
+import java.util.Map;
+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 PopulateComponentUuidColumnsOfSnapshots extends BaseDataChange {
+
+  public PopulateComponentUuidColumnsOfSnapshots(Database db) {
+    super(db);
+  }
+
+  @Override
+  public void execute(Context context) throws SQLException {
+    Map<Long, String> componentUuidById = buildComponentUuidMap(context);
+    if (componentUuidById.isEmpty()) {
+      return;
+    }
+
+    populateUuidColumns(context, componentUuidById);
+  }
+
+  private static Map<Long, String> buildComponentUuidMap(Context context) throws SQLException {
+    Map<Long, String> componentUuidById = new HashMap<>();
+    context.prepareSelect("select distinct p.id, p.uuid from projects p" +
+      " join snapshots sn1 on sn1.project_id = p.id and sn1.component_uuid is null")
+      .scroll(row -> componentUuidById.put(row.getLong(1), row.getString(2)));
+    context.prepareSelect("select distinct p.id, p.uuid from projects p" +
+      " join snapshots sn2 on sn2.root_project_id = p.id and sn2.root_component_uuid is null")
+      .scroll(row -> componentUuidById.put(row.getLong(1), row.getString(2)));
+    return componentUuidById;
+  }
+
+  private void populateUuidColumns(Context context, Map<Long, String> componentUuidById) throws SQLException {
+    MassUpdate massUpdate = context.prepareMassUpdate();
+    massUpdate.select("SELECT sn.id, sn.project_id, sn.root_project_id from snapshots sn where sn.component_uuid is null or sn.root_component_uuid is null");
+    massUpdate.update("UPDATE snapshots SET component_uuid=?, root_component_uuid=? WHERE id=?");
+    massUpdate.rowPluralName("snapshots");
+    massUpdate.execute((row, update) -> this.handle(componentUuidById, row, update));
+  }
+
+  private boolean handle(Map<Long, String> componentUuidById, Select.Row row, SqlStatement update) throws SQLException {
+    long id = row.getLong(1);
+    long componentId = row.getLong(2);
+    long rootProjectId = row.getLong(3);
+
+    String componentUuid = componentUuidById.get(componentId);
+    String rootComponentUuid = componentUuidById.get(rootProjectId);
+
+    if (componentUuid == null && rootComponentUuid == null) {
+      return false;
+    }
+
+    update.setString(1, componentUuid);
+    update.setString(2, rootComponentUuid);
+    update.setLong(3, id);
+
+    return true;
+  }
+
+}
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateUuidColumnOnSnapshots.java b/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateUuidColumnOnSnapshots.java
new file mode 100644 (file)
index 0000000..214e62a
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * 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.core.util.UuidFactory;
+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 PopulateUuidColumnOnSnapshots extends BaseDataChange {
+
+  private final UuidFactory uuidFactory;
+
+  public PopulateUuidColumnOnSnapshots(Database db, UuidFactory uuidFactory) {
+    super(db);
+    this.uuidFactory = uuidFactory;
+  }
+
+  @Override
+  public void execute(Context context) throws SQLException {
+    MassUpdate massUpdate = context.prepareMassUpdate();
+    massUpdate.select("SELECT s.id from snapshots s where s.uuid is null");
+    massUpdate.update("UPDATE snapshots SET uuid=? WHERE id=?");
+    massUpdate.rowPluralName("snapshots");
+    massUpdate.execute(this::handle);
+  }
+
+  private boolean handle(Select.Row row, SqlStatement update) throws SQLException {
+    long id = row.getLong(1);
+    update.setString(1, uuidFactory.create());
+    update.setLong(2, id);
+    return true;
+  }
+
+}
diff --git a/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateUuidColumnsOfSnapshots.java b/sonar-db/src/main/java/org/sonar/db/version/v60/PopulateUuidColumnsOfSnapshots.java
deleted file mode 100644 (file)
index 4fb0fd2..0000000
+++ /dev/null
@@ -1,85 +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.HashMap;
-import java.util.Map;
-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 PopulateUuidColumnsOfSnapshots extends BaseDataChange {
-
-  public PopulateUuidColumnsOfSnapshots(Database db) {
-    super(db);
-  }
-
-  @Override
-  public void execute(Context context) throws SQLException {
-    Map<Long, String> componentUuidById = buildComponentUuidMap(context);
-    if (componentUuidById.isEmpty()) {
-      return;
-    }
-
-    populateUuidColumns(context, componentUuidById);
-  }
-
-  private static Map<Long, String> buildComponentUuidMap(Context context) throws SQLException {
-    Map<Long, String> componentUuidById = new HashMap<>();
-    context.prepareSelect("select distinct p.id, p.uuid from projects p" +
-      " join snapshots sn1 on sn1.project_id = p.id and sn1.component_uuid is null")
-      .scroll(row -> componentUuidById.put(row.getLong(1), row.getString(2)));
-    context.prepareSelect("select distinct p.id, p.uuid from projects p" +
-      " join snapshots sn2 on sn2.root_project_id = p.id and sn2.root_component_uuid is null")
-      .scroll(row -> componentUuidById.put(row.getLong(1), row.getString(2)));
-    return componentUuidById;
-  }
-
-  private void populateUuidColumns(Context context, Map<Long, String> componentUuidById) throws SQLException {
-    MassUpdate massUpdate = context.prepareMassUpdate();
-    massUpdate.select("SELECT sn.id, sn.project_id, sn.root_project_id from snapshots sn where sn.component_uuid is null or sn.root_component_uuid is null");
-    massUpdate.update("UPDATE snapshots SET component_uuid=?, root_component_uuid=? WHERE id=?");
-    massUpdate.rowPluralName("snapshots");
-    massUpdate.execute((row, update) -> this.handle(componentUuidById, row, update));
-  }
-
-  private boolean handle(Map<Long, String> componentUuidById, Select.Row row, SqlStatement update) throws SQLException {
-    long id = row.getLong(1);
-    long componentId = row.getLong(2);
-    long rootProjectId = row.getLong(3);
-
-    String componentUuid = componentUuidById.get(componentId);
-    String rootComponentUuid = componentUuidById.get(rootProjectId);
-
-    if (componentUuid == null && rootComponentUuid == null) {
-      return false;
-    }
-
-    update.setString(1, componentUuid);
-    update.setString(2, rootComponentUuid);
-    update.setLong(3, id);
-
-    return true;
-  }
-
-}
index 6d64f244d3b7aa653bc03c4191b3585bccd54be8..4c81f73de09175a22b19e7f4a2c3ee92d9716279 100644 (file)
@@ -4,6 +4,7 @@
 
   <sql id="snapshotColumns">
     s.id,
+    s.uuid as uuid,
     s.parent_snapshot_id as parentId,
     s.root_snapshot_id as rootId,
     s.root_component_uuid as rootComponentUuid,
     order by created_at desc
   </select>
 
-  <sql id="insertColumns">
-    (parent_snapshot_id, root_snapshot_id, root_component_uuid, component_uuid, created_at, build_date, status, purge_status,
-    islast, scope, qualifier, version, path, depth,
-    period1_mode, period2_mode, period3_mode, period4_mode, period5_mode,
-    period1_param, period2_param, period3_param, period4_param, period5_param,
-    period1_date, period2_date, period3_date, period4_date, period5_date)
-  </sql>
 
   <update id="updateSnapshotAndChildrenLastFlagAndStatus" parameterType="map">
     update snapshots
   </update>
 
   <insert id="insert" parameterType="Snapshot" keyColumn="id" useGeneratedKeys="true" keyProperty="id">
-    insert into snapshots
-    <include refid="insertColumns"/>
-    values (#{parentId}, #{rootId}, #{rootComponentUuid}, #{componentUuid}, #{createdAt}, #{buildDate}, #{status},
-    #{purgeStatus}, #{last}, #{scope}, #{qualifier}, #{version}, #{path}, #{depth},
-    #{period1Mode}, #{period2Mode}, #{period3Mode}, #{period4Mode}, #{period5Mode},
-    #{period1Param}, #{period2Param}, #{period3Param}, #{period4Param}, #{period5Param},
-    #{period1Date}, #{period2Date}, #{period3Date}, #{period4Date}, #{period5Date})
+    insert into snapshots (
+    uuid,
+    parent_snapshot_id,
+    root_snapshot_id,
+    root_component_uuid,
+    component_uuid,
+    created_at,
+    build_date,
+    status,
+    purge_status,
+    islast,
+    scope,
+    qualifier,
+    version,
+    path,
+    depth,
+    period1_mode,
+    period2_mode,
+    period3_mode,
+    period4_mode,
+    period5_mode,
+    period1_param,
+    period2_param,
+    period3_param,
+    period4_param,
+    period5_param,
+    period1_date,
+    period2_date,
+    period3_date,
+    period4_date,
+    period5_date)
+    values (
+    #{uuid, jdbcType=VARCHAR},
+    #{parentId, jdbcType=BIGINT},
+    #{rootId, jdbcType=BIGINT},
+    #{rootComponentUuid, jdbcType=VARCHAR},
+    #{componentUuid, jdbcType=VARCHAR},
+    #{createdAt, jdbcType=BIGINT},
+    #{buildDate, jdbcType=BIGINT},
+    #{status, jdbcType=VARCHAR},
+    #{purgeStatus, jdbcType=INTEGER},
+    #{last, jdbcType=BOOLEAN},
+    #{scope, jdbcType=VARCHAR},
+    #{qualifier, jdbcType=VARCHAR},
+    #{version, jdbcType=VARCHAR},
+    #{path, jdbcType=VARCHAR},
+    #{depth, jdbcType=BOOLEAN},
+    #{period1Mode, jdbcType=VARCHAR},
+    #{period2Mode, jdbcType=VARCHAR},
+    #{period3Mode, jdbcType=VARCHAR},
+    #{period4Mode, jdbcType=VARCHAR},
+    #{period5Mode, jdbcType=VARCHAR},
+    #{period1Param, jdbcType=VARCHAR},
+    #{period2Param, jdbcType=VARCHAR},
+    #{period3Param, jdbcType=VARCHAR},
+    #{period4Param, jdbcType=VARCHAR},
+    #{period5Param, jdbcType=VARCHAR},
+    #{period1Date, jdbcType=BIGINT},
+    #{period2Date, jdbcType=BIGINT},
+    #{period3Date, jdbcType=BIGINT},
+    #{period4Date, jdbcType=BIGINT},
+    #{period5Date, jdbcType=BIGINT})
   </insert>
 
 </mapper>
index ef60eb5d94ead3a537089e30ea6d8c62a13a6b59..f35f96c2cdbeba2fe7238fda35820e2f2b6a5986 100644 (file)
@@ -434,6 +434,10 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1224');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1225');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1226');
 INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1227');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1228');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1229');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1230');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('1231');
 
 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;
index 4861e6c87aaf406bd6ab1c95c9032bac7d8cae5a..f0433733cc297b32c359b1536ab538193c1ec3e4 100644 (file)
@@ -54,6 +54,7 @@ CREATE TABLE "GROUPS" (
 
 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,
@@ -577,6 +578,8 @@ CREATE INDEX "SNAPSHOTS_PARENT" ON "SNAPSHOTS" ("PARENT_SNAPSHOT_ID");
 
 CREATE INDEX "SNAPSHOT_COMPONENT" ON "SNAPSHOTS" ("COMPONENT_UUID");
 
+CREATE UNIQUE INDEX "ANALYSES_UUID" ON "SNAPSHOTS" ("UUID");
+
 CREATE INDEX "RULES_PARAMETERS_RULE_ID" ON "RULES_PARAMETERS" ("RULE_ID");
 
 CREATE INDEX "ACTIVE_DASHBOARDS_DASHBOARDID" ON "ACTIVE_DASHBOARDS" ("DASHBOARD_ID");
index ecf6a506df5efe333eb715c4e2a86b8d932b61d1..61b0c00cf179849ca1932ae8da9b9b48f23c0677 100644 (file)
@@ -150,7 +150,11 @@ public class ResourceIndexDaoTest {
     ComponentDto project = new ComponentDto().setUuid(ROOT_UUID).setRootUuid(ROOT_UUID).setKey("the_key").setName(longName).setScope(Scopes.PROJECT).setQualifier(Qualifiers.PROJECT);
     DbSession session = dbTester.getSession();
     dbTester.getDbClient().componentDao().insert(session, project);
-    dbTester.getDbClient().snapshotDao().insert(session, new SnapshotDto().setComponentUuid(project.uuid()).setRootComponentUuid(project.uuid()).setLast(true));
+    dbTester.getDbClient().snapshotDao().insert(session, new SnapshotDto()
+      .setUuid("u1")
+      .setComponentUuid(project.uuid())
+      .setRootComponentUuid(project.uuid())
+      .setLast(true));
 
     underTest.indexProject(session, project.uuid());
     session.commit();
index b10abdb2d3cc2cf8d2d09b99cc0400f7a97b2a7d..fa8bfbee32fbae0ca1f8e65890a4aad1e092399c 100644 (file)
@@ -62,6 +62,7 @@ public class SnapshotDaoTest {
     SnapshotDto result = underTest.selectById(db.getSession(), 3L);
     assertThat(result).isNotNull();
     assertThat(result.getId()).isEqualTo(3L);
+    assertThat(result.getUuid()).isEqualTo("u3");
     assertThat(result.getComponentUuid()).isEqualTo("uuid_3");
     assertThat(result.getRootComponentUuid()).isEqualTo("uuid_1");
     assertThat(result.getParentId()).isEqualTo(2L);
@@ -254,8 +255,8 @@ public class SnapshotDaoTest {
     db.prepareDbUnit(getClass(), "empty.xml");
 
     underTest.insert(db.getSession(),
-      new SnapshotDto().setComponentUuid("uuid_1").setRootComponentUuid("uuid_1").setLast(false),
-      new SnapshotDto().setComponentUuid("uuid_2").setRootComponentUuid("uuid_1").setLast(false));
+      new SnapshotDto().setComponentUuid("uuid_1").setRootComponentUuid("uuid_1").setLast(false).setUuid("u5"),
+      new SnapshotDto().setComponentUuid("uuid_2").setRootComponentUuid("uuid_1").setLast(false).setUuid("u6"));
     db.getSession().commit();
 
     assertThat(db.countRowsOfTable("snapshots")).isEqualTo(2);
@@ -336,6 +337,7 @@ public class SnapshotDaoTest {
 
   private static SnapshotDto defaultSnapshot() {
     return new SnapshotDto()
+      .setUuid("u1")
       .setComponentUuid("uuid_3")
       .setRootComponentUuid("uuid_1")
       .setParentId(2L)
index 7d0bc76e77a7894ed221bdda0d9e306cea8af401..c2ef9e2f84e59505683bd7f0d18a2c6d2be43ef9 100644 (file)
@@ -19,6 +19,7 @@
  */
 package org.sonar.db.component;
 
+import org.apache.commons.lang.RandomStringUtils;
 import org.assertj.core.util.Strings;
 
 import static com.google.common.base.Preconditions.checkNotNull;
@@ -61,6 +62,7 @@ public class SnapshotTesting {
     checkNotNull(component.getId(), "The project need to be persisted before creating this snapshot");
     checkNotNull(rootComponentUuid, "Root component uuid is null");
     return new SnapshotDto()
+      .setUuid(RandomStringUtils.randomAlphanumeric(40))
       .setComponentUuid(component.uuid())
       .setRootComponentUuid(rootComponentUuid)
       .setStatus(SnapshotDto.STATUS_PROCESSED)
index 3913321d571ece1c525f6a93f28dcee57dbec851..fdc2ab7ccec6752797405775cc0d4d368f53ec2b 100644 (file)
@@ -405,7 +405,7 @@ public class MeasureDaoTest {
     long otherDeveloperId = 666l;
 
     ComponentDto projectDto = insertProject("aa");
-    SnapshotDto snapshotDto = insertSnapshot(projectDto, true);
+    SnapshotDto snapshotDto = insertSnapshot("u1", projectDto, true);
     insertMeasure(projectDto, snapshotDto, DEVELOPER_ID, NCLOC_METRIC_ID, 12d);
 
     List<MeasureDto> measureDtos = underTest.selectProjectMeasuresByDeveloperForMetrics(dbSession, DEVELOPER_ID, ImmutableList.of(NCLOC_METRIC_ID));
@@ -426,9 +426,9 @@ public class MeasureDaoTest {
     long otherDeveloperId = 666l;
 
     ComponentDto projectDto = insertProject("aa");
-    SnapshotDto nonLastSnapshotDto = insertSnapshot(projectDto, false);
+    SnapshotDto nonLastSnapshotDto = insertSnapshot("u1", projectDto, false);
     insertMeasure(projectDto, nonLastSnapshotDto, DEVELOPER_ID, NCLOC_METRIC_ID, 12d);
-    SnapshotDto lastSnapshotDto = insertSnapshot(projectDto, true);
+    SnapshotDto lastSnapshotDto = insertSnapshot("u2", projectDto, true);
     insertMeasure(projectDto, lastSnapshotDto, otherDeveloperId, NCLOC_METRIC_ID, 15d);
 
     assertThat(underTest.selectProjectMeasuresByDeveloperForMetrics(dbSession, DEVELOPER_ID, ImmutableList.of(NCLOC_METRIC_ID))).hasSize(0);
@@ -446,13 +446,13 @@ public class MeasureDaoTest {
   @Test
   public void selectProjectMeasuresByDeveloperForMetrics_returns_ignores_snapshots_of_any_component_but_project() {
     ComponentDto projectDto = insertProject("aa");
-    insertSnapshot(projectDto, true);
+    insertSnapshot("u1", projectDto, true);
     ComponentDto moduleDto = insertComponent(ComponentTesting.newModuleDto(projectDto));
-    insertMeasure(moduleDto, insertSnapshot(moduleDto, true), DEVELOPER_ID, NCLOC_METRIC_ID, 15d);
+    insertMeasure(moduleDto, insertSnapshot("u2", moduleDto, true), DEVELOPER_ID, NCLOC_METRIC_ID, 15d);
     ComponentDto dirDto = insertComponent(ComponentTesting.newDirectory(moduleDto, "toto"));
-    insertMeasure(dirDto, insertSnapshot(dirDto, true), DEVELOPER_ID, NCLOC_METRIC_ID, 25d);
+    insertMeasure(dirDto, insertSnapshot("u3", dirDto, true), DEVELOPER_ID, NCLOC_METRIC_ID, 25d);
     ComponentDto fileDto = insertComponent(ComponentTesting.newFileDto(moduleDto, "tutu"));
-    insertMeasure(fileDto, insertSnapshot(fileDto, true), DEVELOPER_ID, NCLOC_METRIC_ID, 35d);
+    insertMeasure(fileDto, insertSnapshot("u4", fileDto, true), DEVELOPER_ID, NCLOC_METRIC_ID, 35d);
 
     assertThat(underTest.selectProjectMeasuresByDeveloperForMetrics(dbSession, DEVELOPER_ID, ImmutableList.of(NCLOC_METRIC_ID))).isEmpty();
   }
@@ -468,9 +468,13 @@ public class MeasureDaoTest {
     return insertComponent(projectDto);
   }
 
-  private SnapshotDto insertSnapshot(ComponentDto componentDto, boolean last) {
-    SnapshotDto snapshotDto = new SnapshotDto().setComponentUuid(componentDto.uuid()).setRootComponentUuid(componentDto.projectUuid())
-      .setLast(last).setQualifier(componentDto.qualifier()).setScope(componentDto.scope());
+  private SnapshotDto insertSnapshot(String uuid, ComponentDto componentDto, boolean last) {
+    SnapshotDto snapshotDto = new SnapshotDto()
+      .setUuid(uuid)
+      .setComponentUuid(componentDto.uuid())
+      .setRootComponentUuid(componentDto.projectUuid())
+      .setLast(last)
+      .setQualifier(componentDto.qualifier()).setScope(componentDto.scope());
     dbClient.snapshotDao().insert(dbSession, snapshotDto);
     dbSession.commit();
     return snapshotDto;
index 01cfda06075454dbf72035a4a9bf015d5b12e0a0..27ad48aceb84ab40c790db2dbaeaf434c1281ced 100644 (file)
@@ -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(87);
+    assertThat(container.size()).isEqualTo(90);
   }
 }
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/AddComponentUuidColumnsToSnapshotsTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/AddComponentUuidColumnsToSnapshotsTest.java
new file mode 100644 (file)
index 0000000..0c40da0
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * 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 AddComponentUuidColumnsToSnapshotsTest {
+
+  private static final String SNAPSHOTS_TABLE = "snapshots";
+
+  @Rule
+  public DbTester db = DbTester.createForSchema(System2.INSTANCE, AddComponentUuidColumnsToSnapshotsTest.class, "old_snapshots.sql");
+  @Rule
+  public ExpectedException expectedException = ExpectedException.none();
+
+  private AddComponentUuidColumnsToSnapshots underTest = new AddComponentUuidColumnsToSnapshots(db.database());
+
+  @Test
+  public void migration_adds_columns_to_empty_table() throws SQLException {
+    underTest.execute();
+
+    verifyAddedColumns();
+  }
+
+  @Test
+  public void migration_adds_columns_to_populated_table() throws SQLException {
+    for (int i = 0; i < 9; i++) {
+      db.executeInsert(
+          SNAPSHOTS_TABLE,
+          "PROJECT_ID", valueOf(i),
+          "ISLAST", "TRUE");
+    }
+    db.commit();
+
+    underTest.execute();
+
+    verifyAddedColumns();
+  }
+
+  private void verifyAddedColumns() {
+    db.assertColumnDefinition(SNAPSHOTS_TABLE, "component_uuid", Types.VARCHAR, 50, true);
+    db.assertColumnDefinition(SNAPSHOTS_TABLE, "root_component_uuid", Types.VARCHAR, 50, true);
+  }
+
+  @Test
+  public void migration_is_not_reentrant() throws SQLException {
+    underTest.execute();
+
+    expectedException.expect(IllegalStateException.class);
+    expectedException.expectMessage("Fail to execute ");
+    underTest.execute();
+  }
+}
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/AddUuidColumnToSnapshotsTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/AddUuidColumnToSnapshotsTest.java
new file mode 100644 (file)
index 0000000..eb1cde5
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * 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 AddUuidColumnToSnapshotsTest {
+  @Rule
+  public DbTester db = DbTester.createForSchema(System2.INSTANCE, AddUuidColumnToSnapshotsTest.class, "old_snapshots.sql");
+  @Rule
+  public ExpectedException expectedException = ExpectedException.none();
+
+  private AddUuidColumnToSnapshots underTest = new AddUuidColumnToSnapshots(db.database());
+
+  @Test
+  public void migration_adds_columns_to_empty_table() throws SQLException {
+    underTest.execute();
+
+    verifyAddedColumns();
+  }
+
+  @Test
+  public void migration_adds_column_to_populated_table() throws SQLException {
+    for (int i = 0; i < 9; i++) {
+      db.executeInsert(
+        "snapshots",
+        "component_uuid", valueOf(i),
+        "root_component_uuid", valueOf(i + 10),
+        "QUALIFIER", (i % 2 == 0 ? "FIL" : "TRK"));
+    }
+    db.commit();
+
+    underTest.execute();
+
+    verifyAddedColumns();
+  }
+
+  @Test
+  public void migration_is_not_reentrant() throws SQLException {
+    underTest.execute();
+
+    expectedException.expect(IllegalStateException.class);
+    expectedException.expectMessage("Fail to execute ");
+    underTest.execute();
+  }
+
+  private void verifyAddedColumns() {
+    db.assertColumnDefinition("snapshots", "uuid", Types.VARCHAR, 50, true);
+  }
+
+}
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/AddUuidColumnsToSnapshotsTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/AddUuidColumnsToSnapshotsTest.java
deleted file mode 100644 (file)
index ec76166..0000000
+++ /dev/null
@@ -1,78 +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 AddUuidColumnsToSnapshotsTest {
-
-  private static final String SNAPSHOTS_TABLE = "snapshots";
-
-  @Rule
-  public DbTester db = DbTester.createForSchema(System2.INSTANCE, AddUuidColumnsToSnapshotsTest.class, "old_snapshots.sql");
-  @Rule
-  public ExpectedException expectedException = ExpectedException.none();
-
-  private AddUuidColumnsToSnapshots underTest = new AddUuidColumnsToSnapshots(db.database());
-
-  @Test
-  public void migration_adds_columns_to_empty_table() throws SQLException {
-    underTest.execute();
-
-    verifyAddedColumns();
-  }
-
-  @Test
-  public void migration_adds_columns_to_populated_table() throws SQLException {
-    for (int i = 0; i < 9; i++) {
-      db.executeInsert(
-          SNAPSHOTS_TABLE,
-          "PROJECT_ID", valueOf(i),
-          "ISLAST", "TRUE");
-    }
-    db.commit();
-
-    underTest.execute();
-
-    verifyAddedColumns();
-  }
-
-  private void verifyAddedColumns() {
-    db.assertColumnDefinition(SNAPSHOTS_TABLE, "component_uuid", Types.VARCHAR, 50, true);
-    db.assertColumnDefinition(SNAPSHOTS_TABLE, "root_component_uuid", Types.VARCHAR, 50, true);
-  }
-
-  @Test
-  public void migration_is_not_reentrant() throws SQLException {
-    underTest.execute();
-
-    expectedException.expect(IllegalStateException.class);
-    expectedException.expectMessage("Fail to execute ");
-    underTest.execute();
-  }
-}
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/MakeComponentUuidColumnsNotNullOnSnapshotsTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/MakeComponentUuidColumnsNotNullOnSnapshotsTest.java
new file mode 100644 (file)
index 0000000..2263e9e
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * 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 MakeComponentUuidColumnsNotNullOnSnapshotsTest {
+
+  private static final String SNAPSHOTS_TABLE = "snapshots";
+
+  @Rule
+  public DbTester db = DbTester.createForSchema(System2.INSTANCE, MakeComponentUuidColumnsNotNullOnSnapshotsTest.class,
+    "in_progress_snapshots.sql");
+  @Rule
+  public ExpectedException expectedException = ExpectedException.none();
+
+  private MakeComponentUuidColumnsNotNullOnSnapshots underTest = new MakeComponentUuidColumnsNotNullOnSnapshots(db.database());
+
+  @Test
+  public void migration_sets_uuid_columns_not_nullable_on_empty_table() throws SQLException {
+    underTest.execute();
+
+    verifyColumnDefinitions();
+  }
+
+  @Test
+  public void migration_sets_uuid_columns_not_nullable_on_populated_table() throws SQLException {
+    insertSnapshots(1, true, true);
+    insertSnapshots(2, true, true);
+
+    underTest.execute();
+
+    verifyColumnDefinitions();
+  }
+
+  @Test
+  public void migration_fails_if_some_uuid_columns_are_null() throws SQLException {
+    insertSnapshots(1, false, true);
+
+    expectedException.expect(IllegalStateException.class);
+    expectedException.expectMessage("Fail to execute");
+
+    underTest.execute();
+  }
+
+  private void verifyColumnDefinitions() {
+    db.assertColumnDefinition(SNAPSHOTS_TABLE, "component_uuid", Types.VARCHAR, 50, false);
+    db.assertColumnDefinition(SNAPSHOTS_TABLE, "root_component_uuid", Types.VARCHAR, 50, false);
+  }
+
+  private void insertSnapshots(long id, boolean hasComponentUiid, boolean hasRootComponentUuid) {
+    db.executeInsert(
+      SNAPSHOTS_TABLE,
+      "ID", valueOf(id),
+      "ISLAST", "TRUE",
+      "PROJECT_ID", valueOf(id + 300),
+      "COMPONENT_UUID", hasComponentUiid ? "uuid_" + id : null,
+      "ROOT_COMPONENT_UUID", hasRootComponentUuid ? "root_uuid_" + id : null);
+  }
+
+}
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/MakeUuidColumnNotNullOnSnapshotsTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/MakeUuidColumnNotNullOnSnapshotsTest.java
new file mode 100644 (file)
index 0000000..b079bf6
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * 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 MakeUuidColumnNotNullOnSnapshotsTest {
+
+  private static final String TABLE_SNAPSHOTS = "snapshots";
+
+  @Rule
+  public DbTester db = DbTester.createForSchema(System2.INSTANCE, MakeUuidColumnNotNullOnSnapshotsTest.class,
+    "in_progress_snapshots.sql");
+  @Rule
+  public ExpectedException expectedException = ExpectedException.none();
+
+  private MakeUuidColumnNotNullOnSnapshots underTest = new MakeUuidColumnNotNullOnSnapshots(db.database());
+
+  @Test
+  public void migration_sets_uuid_column_not_nullable_on_empty_table() throws SQLException {
+    underTest.execute();
+
+    verifyColumnDefinitions();
+  }
+
+  @Test
+  public void migration_sets_uuid_column_not_nullable_on_populated_table() throws SQLException {
+    insertSnapshot(1, true);
+    insertSnapshot(2, true);
+
+    underTest.execute();
+
+    verifyColumnDefinitions();
+  }
+
+  @Test
+  public void migration_fails_if_some_row_has_a_null_uuid() throws SQLException {
+    insertSnapshot(1, false);
+
+    expectedException.expect(IllegalStateException.class);
+    expectedException.expectMessage("Fail to execute");
+
+    underTest.execute();
+  }
+
+
+  private void verifyColumnDefinitions() {
+    db.assertColumnDefinition(TABLE_SNAPSHOTS, "uuid", Types.VARCHAR, 50, false);
+  }
+
+  private String insertSnapshot(long id, boolean hasUuid) {
+    String uuid = "uuid_" + id;
+    db.executeInsert(
+      TABLE_SNAPSHOTS,
+      "ID", valueOf(id),
+      "COMPONENT_UUID", valueOf(id + 10),
+      "ROOT_COMPONENT_UUID", valueOf(id + 100),
+      "UUID", hasUuid ? "uuid_" + id : null);
+    return uuid;
+  }
+
+}
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/MakeUuidColumnsNotNullOnSnapshotsTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/MakeUuidColumnsNotNullOnSnapshotsTest.java
deleted file mode 100644 (file)
index da9b16c..0000000
+++ /dev/null
@@ -1,86 +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 MakeUuidColumnsNotNullOnSnapshotsTest {
-
-  private static final String SNAPSHOTS_TABLE = "snapshots";
-
-  @Rule
-  public DbTester db = DbTester.createForSchema(System2.INSTANCE, MakeUuidColumnsNotNullOnSnapshotsTest.class,
-    "in_progress_snapshots.sql");
-  @Rule
-  public ExpectedException expectedException = ExpectedException.none();
-
-  private MakeUuidColumnsNotNullOnSnapshots underTest = new MakeUuidColumnsNotNullOnSnapshots(db.database());
-
-  @Test
-  public void migration_sets_uuid_columns_not_nullable_on_empty_table() throws SQLException {
-    underTest.execute();
-
-    verifyColumnDefinitions();
-  }
-
-  @Test
-  public void migration_sets_uuid_columns_not_nullable_on_populated_table() throws SQLException {
-    insertSnapshots(1, true, true);
-    insertSnapshots(2, true, true);
-
-    underTest.execute();
-
-    verifyColumnDefinitions();
-  }
-
-  @Test
-  public void migration_fails_if_some_uuid_columns_are_null() throws SQLException {
-    insertSnapshots(1, false, true);
-
-    expectedException.expect(IllegalStateException.class);
-    expectedException.expectMessage("Fail to execute");
-
-    underTest.execute();
-  }
-
-  private void verifyColumnDefinitions() {
-    db.assertColumnDefinition(SNAPSHOTS_TABLE, "component_uuid", Types.VARCHAR, 50, false);
-    db.assertColumnDefinition(SNAPSHOTS_TABLE, "root_component_uuid", Types.VARCHAR, 50, false);
-  }
-
-  private void insertSnapshots(long id, boolean hasComponentUiid, boolean hasRootComponentUuid) {
-    db.executeInsert(
-      SNAPSHOTS_TABLE,
-      "ID", valueOf(id),
-      "ISLAST", "TRUE",
-      "PROJECT_ID", valueOf(id + 300),
-      "COMPONENT_UUID", hasComponentUiid ? "uuid_" + id : null,
-      "ROOT_COMPONENT_UUID", hasRootComponentUuid ? "root_uuid_" + id : null);
-  }
-
-}
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshotsTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshotsTest.java
new file mode 100644 (file)
index 0000000..ce48332
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * 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.Map;
+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 PopulateComponentUuidColumnsOfSnapshotsTest {
+
+  private static final String SNAPSHOTS_TABLE = "snapshots";
+
+  @Rule
+  public DbTester db = DbTester.createForSchema(System2.INSTANCE, PopulateComponentUuidColumnsOfSnapshotsTest.class,
+      "in_progress_snapshots_with_projects.sql");
+
+  private PopulateComponentUuidColumnsOfSnapshots underTest = new PopulateComponentUuidColumnsOfSnapshots(db.database());
+
+  @Test
+  public void migration_has_no_effect_on_empty_tables() throws SQLException {
+    underTest.execute();
+
+    assertThat(db.countRowsOfTable(SNAPSHOTS_TABLE)).isEqualTo(0);
+    assertThat(db.countRowsOfTable("projects")).isEqualTo(0);
+  }
+
+  @Test
+  public void migration_updates_uuid_columns_with_values_from_table_projects_when_they_exist() throws SQLException {
+    String uuid1 = insertComponent(40);
+    String uuid2 = insertComponent(50);
+    String uuid3 = insertComponent(60);
+    String uuid4 = insertComponent(70);
+    String uuid5 = insertComponent(80);
+
+    insertSnapshots(1, 40, 50L);
+    insertSnapshots(2, 60, 70L);
+    insertSnapshots(3, 90, 70L); // 90 does not exist
+    insertSnapshots(4, 40, 100L); // 100 does not exist
+    insertSnapshots(5, 110, 100L); // 110 and 100 do not exist
+    insertSnapshots(6, 80, null); // no root
+    insertSnapshots(7, 120, null); // no root and 120 does not exist
+    db.commit();
+
+    underTest.execute();
+
+    verifySnapshots(1, 40, uuid1, 50L, uuid2);
+    verifySnapshots(2, 60, uuid3, 70L, uuid4);
+    verifySnapshots(3, 90, null, 70L, uuid4);
+    verifySnapshots(4, 40, uuid1, 100L, null);
+    verifySnapshots(5, 110, null, 100L, null);
+    verifySnapshots(6, 80, uuid5, null, null);
+    verifySnapshots(7, 120, null, null, null);
+  }
+
+  @Test
+  public void migration_is_reentrant() throws SQLException {
+    String uuid1 = insertComponent(40);
+    String uuid2 = insertComponent(50);
+    insertSnapshots(1, 40, 50L);
+
+    underTest.execute();
+    verifySnapshots(1, 40, uuid1, 50L, uuid2);
+
+    underTest.execute();
+    verifySnapshots(1, 40, uuid1, 50L, uuid2);
+  }
+
+  private void insertSnapshots(long id, long projectId, @Nullable Long rootId) {
+    db.executeInsert(
+        SNAPSHOTS_TABLE,
+        "ID", valueOf(id),
+        "ISLAST", "TRUE",
+        "PROJECT_ID", valueOf(projectId),
+        "ROOT_PROJECT_ID", rootId == null ? null : valueOf(rootId));
+  }
+
+  private String insertComponent(long id) {
+    String uuid = "uuid_" + id;
+    db.executeInsert(
+        "projects",
+        "ID", valueOf(id),
+        "UUID", uuid);
+    return uuid;
+  }
+
+  private void verifySnapshots(long id, long resourceId, @Nullable String componentUuid, @Nullable Long rootProjectId, @Nullable String rootComponentUuid) {
+    List<Map<String, Object>> rows = db.select("select PROJECT_ID, COMPONENT_UUID, ROOT_PROJECT_ID, ROOT_COMPONENT_UUID from snapshots where ID=" + id);
+    assertThat(rows).hasSize(1);
+    Map<String, Object> row = rows.get(0);
+    assertThat(row.get("PROJECT_ID")).isEqualTo(resourceId);
+    assertThat(row.get("COMPONENT_UUID")).isEqualTo(componentUuid);
+    assertThat(row.get("ROOT_PROJECT_ID")).isEqualTo(rootProjectId);
+    assertThat(row.get("ROOT_COMPONENT_UUID")).isEqualTo(rootComponentUuid);
+  }
+
+}
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateUuidColumnOnSnapshotsTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateUuidColumnOnSnapshotsTest.java
new file mode 100644 (file)
index 0000000..8b55518
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * 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.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import org.apache.commons.lang.StringUtils;
+import org.junit.Rule;
+import org.junit.Test;
+import org.sonar.api.utils.System2;
+import org.sonar.core.util.UuidFactoryImpl;
+import org.sonar.db.DbTester;
+
+import static java.lang.String.valueOf;
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class PopulateUuidColumnOnSnapshotsTest {
+
+  private static final String TABLE_SNAPSHOTS = "snapshots";
+
+  @Rule
+  public DbTester db = DbTester.createForSchema(System2.INSTANCE, PopulateUuidColumnOnSnapshotsTest.class,
+    "in_progress_snapshots.sql");
+
+  private PopulateUuidColumnOnSnapshots underTest = new PopulateUuidColumnOnSnapshots(db.database(), UuidFactoryImpl.INSTANCE);
+
+  @Test
+  public void migration_has_no_effect_on_empty_tables() throws SQLException {
+    underTest.execute();
+
+    assertThat(db.countRowsOfTable(TABLE_SNAPSHOTS)).isEqualTo(0);
+  }
+
+  @Test
+  public void migration_generates_uuids() throws SQLException {
+    insertSnapshot(1);
+    insertSnapshot(2);
+    insertSnapshot(3);
+    db.commit();
+
+    underTest.execute();
+
+    verifyUuids(3);
+  }
+
+  private void verifyUuids(int expectedCount) {
+    List<Map<String, Object>> rows = db.select("select uuid from snapshots where uuid is not null");
+    Set<Object> uuids = rows.stream().map(cols -> cols.get("UUID")).filter(uuid -> StringUtils.isNotBlank((String) uuid)).collect(Collectors.toSet());
+    assertThat(uuids).hasSize(expectedCount);
+  }
+
+  @Test
+  public void migration_is_reentrant() throws SQLException {
+    insertSnapshot(1);
+
+    underTest.execute();
+    verifyUuids(1);
+
+    underTest.execute();
+    verifyUuids(1);
+  }
+
+  private String insertSnapshot(long id) {
+    String uuid = "uuid_" + id;
+    db.executeInsert(
+      TABLE_SNAPSHOTS,
+      "ID", valueOf(id),
+      "COMPONENT_UUID", valueOf(id + 10),
+      "ROOT_COMPONENT_UUID", valueOf(id + 100),
+      "SCOPE", "PRJ",
+      "QUALIFIER", "FIL");
+    return uuid;
+  }
+
+}
diff --git a/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateUuidColumnsOfSnapshotsTest.java b/sonar-db/src/test/java/org/sonar/db/version/v60/PopulateUuidColumnsOfSnapshotsTest.java
deleted file mode 100644 (file)
index 11dabd5..0000000
+++ /dev/null
@@ -1,121 +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.Map;
-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 PopulateUuidColumnsOfSnapshotsTest {
-
-  private static final String SNAPSHOTS_TABLE = "snapshots";
-
-  @Rule
-  public DbTester db = DbTester.createForSchema(System2.INSTANCE, PopulateUuidColumnsOfSnapshotsTest.class,
-      "in_progress_snapshots_with_projects.sql");
-
-  private PopulateUuidColumnsOfSnapshots underTest = new PopulateUuidColumnsOfSnapshots(db.database());
-
-  @Test
-  public void migration_has_no_effect_on_empty_tables() throws SQLException {
-    underTest.execute();
-
-    assertThat(db.countRowsOfTable(SNAPSHOTS_TABLE)).isEqualTo(0);
-    assertThat(db.countRowsOfTable("projects")).isEqualTo(0);
-  }
-
-  @Test
-  public void migration_updates_uuid_columns_with_values_from_table_projects_when_they_exist() throws SQLException {
-    String uuid1 = insertComponent(40);
-    String uuid2 = insertComponent(50);
-    String uuid3 = insertComponent(60);
-    String uuid4 = insertComponent(70);
-    String uuid5 = insertComponent(80);
-
-    insertSnapshots(1, 40, 50L);
-    insertSnapshots(2, 60, 70L);
-    insertSnapshots(3, 90, 70L); // 90 does not exist
-    insertSnapshots(4, 40, 100L); // 100 does not exist
-    insertSnapshots(5, 110, 100L); // 110 and 100 do not exist
-    insertSnapshots(6, 80, null); // no root
-    insertSnapshots(7, 120, null); // no root and 120 does not exist
-    db.commit();
-
-    underTest.execute();
-
-    verifySnapshots(1, 40, uuid1, 50L, uuid2);
-    verifySnapshots(2, 60, uuid3, 70L, uuid4);
-    verifySnapshots(3, 90, null, 70L, uuid4);
-    verifySnapshots(4, 40, uuid1, 100L, null);
-    verifySnapshots(5, 110, null, 100L, null);
-    verifySnapshots(6, 80, uuid5, null, null);
-    verifySnapshots(7, 120, null, null, null);
-  }
-
-  @Test
-  public void migration_is_reentrant() throws SQLException {
-    String uuid1 = insertComponent(40);
-    String uuid2 = insertComponent(50);
-    insertSnapshots(1, 40, 50L);
-
-    underTest.execute();
-    verifySnapshots(1, 40, uuid1, 50L, uuid2);
-
-    underTest.execute();
-    verifySnapshots(1, 40, uuid1, 50L, uuid2);
-  }
-
-  private void insertSnapshots(long id, long projectId, @Nullable Long rootId) {
-    db.executeInsert(
-        SNAPSHOTS_TABLE,
-        "ID", valueOf(id),
-        "ISLAST", "TRUE",
-        "PROJECT_ID", valueOf(projectId),
-        "ROOT_PROJECT_ID", rootId == null ? null : valueOf(rootId));
-  }
-
-  private String insertComponent(long id) {
-    String uuid = "uuid_" + id;
-    db.executeInsert(
-        "projects",
-        "ID", valueOf(id),
-        "UUID", uuid);
-    return uuid;
-  }
-
-  private void verifySnapshots(long id, long resourceId, @Nullable String componentUuid, @Nullable Long rootProjectId, @Nullable String rootComponentUuid) {
-    List<Map<String, Object>> rows = db.select("select PROJECT_ID, COMPONENT_UUID, ROOT_PROJECT_ID, ROOT_COMPONENT_UUID from snapshots where ID=" + id);
-    assertThat(rows).hasSize(1);
-    Map<String, Object> row = rows.get(0);
-    assertThat(row.get("PROJECT_ID")).isEqualTo(resourceId);
-    assertThat(row.get("COMPONENT_UUID")).isEqualTo(componentUuid);
-    assertThat(row.get("ROOT_PROJECT_ID")).isEqualTo(rootProjectId);
-    assertThat(row.get("ROOT_COMPONENT_UUID")).isEqualTo(rootComponentUuid);
-  }
-
-}
index a60d785a90a684b278e1c5b659ae0be3791cf62b..82c7bbbecfd6b0c5b65088b448decb086e93abd2 100644 (file)
@@ -5,36 +5,84 @@
             uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
             scope="PRJ" qualifier="TRK" long_name="Apache Struts" description="the description"
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="[null]"/>
-  <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" islast="[true]" scope="PRJ" qualifier="TRK"/>
-  <snapshots id="10" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]" islast="[false]" scope="PRJ" qualifier="TRK"/>
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             root_snapshot_id="[null]"
+             islast="[true]"
+             scope="PRJ"
+             qualifier="TRK"/>
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             root_snapshot_id="[null]"
+             islast="[false]"
+             scope="PRJ"
+             qualifier="TRK"/>
 
   <!-- module -->
   <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core"
             uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD.EFGH."
             scope="PRJ" qualifier="BRC" long_name="Struts Core" description="[null]"
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/>
-  <snapshots id="2" component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" scope="PRJ" qualifier="BRC"/>
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="EFGH"
+             parent_snapshot_id="1"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             islast="[true]"
+             scope="PRJ"
+             qualifier="BRC"/>
 
   <!-- sub module -->
   <projects id="3" root_uuid="ABCD" kee="org.struts:struts-data" name="Struts Data"
             uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH.FGHI."
             scope="PRJ" qualifier="BRC" long_name="Struts Data" description="[null]"
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/>
-  <snapshots id="3" component_uuid="FGHI" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" scope="PRJ" qualifier="BRC"/>
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="FGHI"
+             parent_snapshot_id="2"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             islast="[true]"
+             scope="PRJ"
+             qualifier="BRC"/>
 
   <!-- directory -->
   <projects id="4" root_uuid="FGHI" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts"
             uuid="GHIJ" project_uuid="ABCD" module_uuid="FGHI" module_uuid_path=".ABCD.EFGH.FGHI."
             name="src/org/struts" long_name="org.struts" description="[null]"
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/>
-  <snapshots id="4" component_uuid="GHIJ" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" scope="DIR" qualifier="DIR"/>
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="GHIJ"
+             parent_snapshot_id="3"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             islast="[true]"
+             scope="DIR"
+             qualifier="DIR"/>
 
   <!-- file -->
   <projects id="5" root_uuid="FGHI" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java"
             uuid="HIJK" project_uuid="ABCD" module_uuid="FGHI" module_uuid_path=".ABCD.EFGH.FGHI."
             name="RequestContext.java" long_name="org.struts.RequestContext" description="[null]"
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/>
-  <snapshots id="5" component_uuid="HIJK" parent_snapshot_id="4" root_component_uuid="ABCD" root_snapshot_id="1" islast="[true]" scope="FIL" qualifier="FIL"/>
+  <snapshots id="5"
+             uuid="u5"
+             component_uuid="HIJK"
+             parent_snapshot_id="4"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             islast="[true]"
+             scope="FIL"
+             qualifier="FIL"/>
 
   <!-- removed sub module -->
   <projects id="10" root_uuid="ABCD" kee="org.struts:struts-data-removed" name="Struts Data Removed"
index 934d4757f1f021a6c2e868a66e88e67dd0146475..57b445759e07b8dda5472a891241396f6dc75a2e 100644 (file)
             uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
             description="the description" long_name="Apache Struts"
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/>
-  <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" 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"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             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=""/>
-  <snapshots id="10" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
-             status="P" islast="[false]" 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="1228136280000" build_date="1228136280000"
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             root_snapshot_id="[null]"
+             status="P" islast="[false]"
+             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="1228136280000"
+             build_date="1228136280000"
              version="[null]" path=""/>
-  <snapshots id="11" component_uuid="PPAA" parent_snapshot_id="[null]" root_component_uuid="PPAA" root_snapshot_id="[null]"
-             status="U" islast="[false]" 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="1228136280000" build_date="1228136280000"
+  <snapshots id="11"
+             uuid="u11"
+             component_uuid="PPAA"
+             parent_snapshot_id="[null]"
+             root_component_uuid="PPAA"
+             root_snapshot_id="[null]"
+             status="U" islast="[false]"
+             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="1228136280000"
+             build_date="1228136280000"
              version="[null]" path=""/>
 
   <!-- module -->
             uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD.EFGH."
             scope="PRJ" qualifier="BRC" long_name="Struts Core"
             description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/>
-  <snapshots id="2" component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
-             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="BRC" created_at="1228222680000" build_date="1228222680000"
-             version="[null]" path="1."/>
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="EFGH"
+             parent_snapshot_id="1"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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="BRC"
+             created_at="1228222680000"
+             build_date="1228222680000"
+             version="[null]"
+             path="1."/>
 
   <!-- directory -->
   <projects long_name="org.struts" id="3" scope="DIR" qualifier="DIR" kee="org.struts:struts-core:src/org/struts"
             name="src/org/struts" root_uuid="EFGH"
             description="[null]"
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/>
-  <snapshots id="3" component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
-             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="DIR" qualifier="PAC" created_at="1228222680000" build_date="1228222680000"
-             version="[null]" path="1.2."/>
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="GHIJ"
+             parent_snapshot_id="2"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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="DIR"
+             qualifier="PAC"
+             created_at="1228222680000"
+             build_date="1228222680000"
+             version="[null]"
+             path="1.2."/>
 
   <!-- file -->
   <projects long_name="org.struts.RequestContext" id="4" scope="FIL" qualifier="FIL" kee="org.struts:struts-core:src/org/struts/RequestContext.java"
             description="[null]"
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/>
 
-  <snapshots id="4" component_uuid="KLMN" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1"
-             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="FIL" qualifier="CLA" created_at="1228222680000" build_date="1228222680000"
-             version="[null]" path="1.2.3."/>
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="KLMN"
+             parent_snapshot_id="3"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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="FIL"
+             qualifier="CLA"
+             created_at="1228222680000"
+             build_date="1228222680000"
+             version="[null]"
+             path="1.2.3."/>
 
   <!-- Disabled projects -->
   <projects id="10" root_uuid="DCBA" scope="PRJ" qualifier="TRK" kee="org.disabled.project" name="Disabled Project"
index cae57657d2722b89b0ac3387a77ccd5f48f526c1..481e2fc98ed3c3b335ce7c9ab104801ce948da45 100644 (file)
             uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
             description="the description" long_name="Apache Struts"
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/>
-  <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             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]"
              period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
-  <snapshots id="10" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
-             status="P" islast="[false]" purge_status="[null]"
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             root_snapshot_id="[null]"
+             status="P"
+             islast="[false]"
+             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]"
             uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD.EFGH."
             scope="PRJ" qualifier="BRC" long_name="Struts Core"
             description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/>
-  <snapshots id="2" component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="EFGH"
+             parent_snapshot_id="1"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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]"
             name="src/org/struts" root_uuid="EFGH"
             description="[null]"
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/>
-  <snapshots id="3" component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="GHIJ"
+             parent_snapshot_id="2"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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]"
             description="[null]"
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/>
 
-  <snapshots id="4" component_uuid="KLMN" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="KLMN"
+             parent_snapshot_id="3"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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]"
index 5fd182fab66f02f09a300c7e4df449e45576011c..f3f8f181d84283dffc86064a8eb6100861090338 100644 (file)
@@ -9,17 +9,35 @@
             uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
             description="the description" long_name="Apache Struts"
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="123456789"/>
-  <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             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=""/>
-  <snapshots id="10" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
-             status="P" islast="[false]" purge_status="[null]"
+             depth="[null]"
+             scope="PRJ"
+             qualifier="TRK"
+             created_at="1228222680000"
+             build_date="1228222680000"
+             version="[null]"
+             path=""/>
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             root_snapshot_id="[null]"
+             status="P" islast="[false]"
+             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]"
             uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD.EFGH."
             scope="PRJ" qualifier="BRC" long_name="Struts Core"
             description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]"/>
-  <snapshots id="2" component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="EFGH"
+             parent_snapshot_id="1"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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]"
             name="src/org/struts" root_uuid="EFGH"
             description="[null]"
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts" authorization_updated_at="[null]"/>
-  <snapshots id="3" component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="GHIJ"
+             parent_snapshot_id="2"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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]"
             description="[null]"
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/>
 
-  <snapshots id="4" component_uuid="KLMN" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="KLMN"
+             parent_snapshot_id="3"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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]"
index 958c16c1150f6b57a88df2f40e3d9ceb7402cf13..b3238a71341a7d7fe5a7f10d14a400dd3084885a 100644 (file)
@@ -6,7 +6,9 @@
             uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="."
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"
             authorization_updated_at="[null]"/>
-  <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" 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]"
@@ -15,7 +17,9 @@
              period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
-  <snapshots id="10" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]"
@@ -31,7 +35,9 @@
             uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
             description="[null]" enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"
             authorization_updated_at="[null]"/>
-  <snapshots id="2" component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
              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]"
@@ -48,7 +54,9 @@
             uuid="GHIJ" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH."
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"
             authorization_updated_at="[null]"/>
-  <snapshots id="3" component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
              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]"
@@ -67,7 +75,9 @@
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"
             authorization_updated_at="[null]"/>
 
-  <snapshots id="4" component_uuid="KLMN" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1"
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="KLMN" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1"
              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]"
             uuid="ONLYERRORS" project_uuid="[null]" module_uuid="[null]" module_uuid_path="."
             description="the description" long_name="Shinding"
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"/>
-  <snapshots id="6" component_uuid="ONLYERRORS" parent_snapshot_id="[null]" root_component_uuid="ONLYERRORS" root_snapshot_id="[null]"
+  <snapshots id="6"
+             uuid="u6"
+             component_uuid="ONLYERRORS"
+             parent_snapshot_id="[null]" root_component_uuid="ONLYERRORS" root_snapshot_id="[null]"
              status="U" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_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=""/>
-  <snapshots id="7" component_uuid="ONLYERRORS" parent_snapshot_id="6" root_component_uuid="ONLYERRORS" root_snapshot_id="6"
+  <snapshots id="7"
+             uuid="u7"
+             component_uuid="ONLYERRORS"
+             parent_snapshot_id="6" root_component_uuid="ONLYERRORS" root_snapshot_id="6"
              status="U" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]"
             description="the description" long_name="Tika"
             uuid="DISABLED" project_uuid="[null]" module_uuid="[null]" module_uuid_path="."
             enabled="[false]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"/>
-  <snapshots id="8" component_uuid="DISABLED" parent_snapshot_id="[null]" root_component_uuid="DISABLED" root_snapshot_id="[null]"
+  <snapshots id="8"
+             uuid="u8"
+             component_uuid="DISABLED"
+             parent_snapshot_id="[null]"
+             root_component_uuid="DISABLED" 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]"
index d4133fab3b50490e3699ed267b24860fedfc754f..7b250e47157fb68523f540653b525e407b0f5134 100644 (file)
             description="the description" long_name="Apache Struts"
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]"
             created_at="2008-12-02" authorization_updated_at="123456789"/>
-  <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             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]"
              period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
-  <snapshots id="10" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
-             status="P" islast="[false]" purge_status="[null]"
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             root_snapshot_id="[null]"
+             status="P"
+             islast="[false]"
+             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]"
             scope="PRJ" qualifier="BRC" long_name="Struts Core"
             description="[null]" enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"
             created_at="2008-12-02" authorization_updated_at="[null]"/>
-  <snapshots id="2" component_uuid="BCDE" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="BCDE"
+             parent_snapshot_id="1"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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]"
             description="[null]"
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]" path="src/org/struts"
             created_at="2008-12-02" authorization_updated_at="[null]"/>
-  <snapshots id="3" component_uuid="CDEF" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="CDEF"
+             parent_snapshot_id="2"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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]"
             path="src/org/struts/RequestContext.java"
             created_at="2008-12-02" authorization_updated_at="[null]"/>
 
-  <snapshots id="4" component_uuid="DEFG" parent_snapshot_id="3" root_component_uuid="ABCD" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="[null]"
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="DEFG"
+             parent_snapshot_id="3"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             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]"
index 9304e9363b6e05b4d6b55cf8070a0f79f504dcd6..6a6e6ed94b9495d19fa1b84f343b68d11facfa51 100644 (file)
@@ -10,7 +10,9 @@
             description="the description" long_name="Apache Struts"
             enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="[null]"
             authorization_updated_at="[null]"/>
-  <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
+  <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="previous_analysis" period1_param="[null]" period1_date="[null]"
              period2_mode="days" period2_param="30" period2_date="1316815200000"
@@ -19,7 +21,9 @@
              period5_mode="previous_version" period5_param="[null]" period5_date="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
-  <snapshots id="10" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
+  <snapshots id="10"
+             uuid="u10"
+             project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]"
@@ -35,7 +39,9 @@
             scope="PRJ" qualifier="BRC" long_name="Struts Core"
             description="[null]" enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"
             authorization_updated_at="[null]"/>
-  <snapshots id="2" project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1"
+  <snapshots id="2"
+             uuid="u2"
+             project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1"
              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]"
@@ -52,7 +58,9 @@
             description="[null]"
             enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts"
             authorization_updated_at="[null]"/>
-  <snapshots id="3" project_id="3" parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1"
+  <snapshots id="3"
+             uuid="u3"
+             project_id="3" parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1"
              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]"
@@ -71,7 +79,9 @@
             enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"
             path="src/org/struts/RequestContext.java" authorization_updated_at="[null]"/>
 
-  <snapshots id="4" project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1"
+  <snapshots id="4"
+             uuid="u4"
+             project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1"
              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]"
index 95fcec6efb062117997b334d4655a55fb3cd6362..58553599c423358bc3c59ad569bf5a821cb5acc0 100644 (file)
             description="[null]"
             enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/>
 
-  <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" project_id="1"/>
-  <snapshots purge_status="[null]" id="2" islast="[true]" root_component_uuid="ABCD" project_id="2"/>
-  <snapshots purge_status="[null]" id="3" islast="[true]" root_component_uuid="ABCD" project_id="3"/>
-  <snapshots purge_status="[null]" id="4" islast="[true]" root_component_uuid="ABCD" project_id="4"/>
+  <snapshots purge_status="[null]"
+             id="1"
+             uuid="u1"
+             islast="[true]" root_component_uuid="ABCD" project_id="1"/>
+  <snapshots purge_status="[null]"
+             id="2"
+             uuid="u2"
+             islast="[true]" root_component_uuid="ABCD" project_id="2"/>
+  <snapshots purge_status="[null]"
+             id="3"
+             uuid="u3"
+             islast="[true]" root_component_uuid="ABCD" project_id="3"/>
+  <snapshots purge_status="[null]"
+             id="4"
+             uuid="u4"
+             islast="[true]" root_component_uuid="ABCD" project_id="4"/>
 
   <!-- The major goal is to test root_project_id -->
 
index ff0f36d95e6b3af138d182c1d7d6f0531571c01d..ff43af42c1865848312b7ea3b46a0ebe655412e9 100644 (file)
             description="[null]"
             enabled="[true]" language="java" />
 
-  <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD"/>
-  <snapshots purge_status="[null]" id="2" islast="[true]" root_component_uuid="ABCD" component_uuid="BCDE"/>
-  <snapshots purge_status="[null]" id="3" islast="[true]" root_component_uuid="ABCD" component_uuid="CDEF"/>
-  <snapshots purge_status="[null]" id="4" islast="[true]" root_component_uuid="ABCD" component_uuid="DEFG"/>
+  <snapshots purge_status="[null]"
+             id="1"
+             uuid="u1"
+             islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD"/>
+  <snapshots purge_status="[null]"
+             id="2"
+             uuid="u2"
+             islast="[true]" root_component_uuid="ABCD" component_uuid="BCDE"/>
+  <snapshots purge_status="[null]"
+             id="3"
+             uuid="u3"
+             islast="[true]" root_component_uuid="ABCD" component_uuid="CDEF"/>
+  <snapshots purge_status="[null]"
+             id="4"
+             uuid="u4"
+             islast="[true]" root_component_uuid="ABCD" component_uuid="DEFG"/>
 </dataset>
index ee9ab480a7c3b23b5a8766a2af7980b787b5891b..9b08be4a74686896ef6abe32d7f0f635d5b72e43 100644 (file)
             description="[null]"
             enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/>
 
-  <snapshots purge_status="[null]" id="1" islast="[true]" root_project_id="1" project_id="1" scope="PRJ"
+  <snapshots purge_status="[null]"
+             id="1"
+             uuid="u1"
+             islast="[true]" root_project_id="1" project_id="1" scope="PRJ"
              qualifier="TRK"/>
-  <snapshots purge_status="[null]" id="2" islast="[true]" root_project_id="1" project_id="2" scope="DIR"
+  <snapshots purge_status="[null]"
+             id="2"
+             uuid="u2"
+             islast="[true]" root_project_id="1" project_id="2" scope="DIR"
              qualifier="PAC"/>
-  <snapshots purge_status="[null]" id="3" islast="[true]" root_project_id="1" project_id="3" scope="CLA"
+  <snapshots purge_status="[null]"
+             id="3"
+             uuid="u3"
+             islast="[true]" root_project_id="1" project_id="3" scope="CLA"
              qualifier="CLA"/>
 
   <!-- RequestContext -->
index 7e76208a0ee633d7888be99479ec57faf65b28ad..60d7f6aa5ae863a0d99b725b7f9319a06d89c094 100644 (file)
             description="[null]"
             enabled="[true]" language="java" />
 
-  <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ"
+  <snapshots purge_status="[null]"
+             id="1"
+             uuid="u1"
+             islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ"
              qualifier="TRK"/>
-  <snapshots purge_status="[null]" id="2" islast="[true]" root_component_uuid="ABCD" component_uuid="BCDE" scope="DIR"
+  <snapshots purge_status="[null]"
+             id="2"
+             uuid="u2"
+             islast="[true]" root_component_uuid="ABCD" component_uuid="BCDE" scope="DIR"
              qualifier="PAC"/>
-  <snapshots purge_status="[null]" id="3" islast="[true]" root_component_uuid="ABCD" component_uuid="CDEF" scope="FIL"
+  <snapshots purge_status="[null]"
+             id="3"
+             islast="[true]"
+             uuid="u3"
+             root_component_uuid="ABCD" component_uuid="CDEF" scope="FIL"
              qualifier="CLA"/>
 </dataset>
index 1c7036cd095c55d8faad552004083ce5c341e984..6cd09bb7cf91a8df6764e5b6b1b7a97efdeed1b5 100644 (file)
@@ -6,7 +6,10 @@
             description="[null]"
             enabled="[true]" language="java"/>
 
-  <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ"
+  <snapshots purge_status="[null]"
+             id="1"
+             uuid="u1"
+             islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ"
              qualifier="TRK"/>
 
   <!-- the index is on the old name "ST" but not on "AS" -->
index c7faa7de4ce4fcbc9f8509d8864bd3c3b889b832..320106fb8450d05500f4587b06fa82df07f6d5af 100644 (file)
@@ -6,7 +6,10 @@
             description="[null]"
             enabled="[true]" language="java" />
 
-  <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ"
+  <snapshots purge_status="[null]"
+             id="1"
+             uuid="u1"
+             islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ"
              qualifier="TRK"/>
 
   <!-- the index is on the old name "ST" but not on "AS" -->
index 1d5c5d31259027fd40c462b98148fa8da3074ffc..a4981c2ff936a4d252ecad293756b3d2986cc06c 100644 (file)
@@ -6,7 +6,9 @@
             description="[null]"
             enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]"/>
 
-  <snapshots purge_status="[null]" id="1" islast="[true]" root_project_id="1" project_id="1" scope="PRJ"
+  <snapshots purge_status="[null]" id="1"
+             uuid="u1"
+             islast="[true]" root_project_id="1" project_id="1" scope="PRJ"
              qualifier="TRK"/>
 
   <resource_index kee="apache struts" position="0" name_size="13" component_uuid="ABCD" root_component_uuid="ABCD" qualifier="TRK"/>
index 6b1066004b3ed7f3b5957a76a58e5c6a87a94e94..31c50efeb96a4bb4a0ae94b71b1dc9ce5fbf5add 100644 (file)
@@ -6,7 +6,10 @@
             description="[null]"
             enabled="[true]" language="java" />
 
-  <snapshots purge_status="[null]" id="1" islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ"
+  <snapshots purge_status="[null]"
+             id="1"
+             uuid="u1"
+             islast="[true]" root_component_uuid="ABCD" component_uuid="ABCD" scope="PRJ"
              qualifier="TRK"/>
 
   <!-- the index is on the old name "Struts" but not on "Apache Struts -->
index 84aeaa2738723fe8dcf6912462841520579e0ec5..fbdd4fc6bc9681968d120c70c36e1d506a3c8524 100644 (file)
@@ -1,11 +1,30 @@
 <dataset>
 
   <!-- Has last snapshot -->
-  <projects id="1" root_uuid="ABCD" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts"
-            uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="."
-            description="the description" long_name="Apache Struts"
-            enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]" authorization_updated_at="[null]" />
-  <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
+  <projects id="1"
+            root_uuid="ABCD"
+            scope="PRJ"
+            qualifier="TRK"
+            kee="org.struts:struts"
+            name="Struts"
+            uuid="ABCD"
+            project_uuid="ABCD"
+            module_uuid="[null]"
+            module_uuid_path="."
+            description="the description"
+            long_name="Apache Struts"
+            enabled="[true]"
+            language="[null]"
+            copy_component_uuid="[null]"
+            developer_uuid="[null]"
+            path="[null]"
+            authorization_updated_at="[null]" />
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             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]"
              period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
-  <snapshots id="10" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
-             status="P" islast="[false]" 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="1228136280000" build_date="1228136280000"
-             version="[null]" path=""/>
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]"
+             root_component_uuid="ABCD"
+             root_snapshot_id="[null]"
+             status="P"
+             islast="[false]"
+             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="1228136280000"
+             build_date="1228136280000"
+             version="[null]"
+             path=""/>
 
   <!-- No snapshot -->
   <projects id="2" root_uuid="ABCD" kee="org.struts:struts-core" name="Struts Core"
             uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH."
             scope="PRJ" qualifier="BRC" long_name="Struts Data"
             description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" authorization_updated_at="[null]" />
-  <snapshots id="3" component_uuid="FGHI" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
-             status="P" islast="[false]" 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="BRC" created_at="1228222680000" build_date="1228222680000"
-             version="[null]" path="1.2."/>
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="FGHI"
+             parent_snapshot_id="2"
+             root_component_uuid="ABCD"
+             root_snapshot_id="1"
+             status="P"
+             islast="[false]"
+             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="BRC"
+             created_at="1228222680000"
+             build_date="1228222680000"
+             version="[null]"
+             path="1.2."/>
 
 </dataset>
index 66e1a4ec3d1bf5deacd13bf9066b08313163270c..41b7453231ae4190017ca218e318605fba40ac3d 100644 (file)
@@ -1,13 +1,35 @@
 <dataset>
 
-  <snapshots id="1" component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="1"
-             period1_mode="days1" period1_param="30" period1_date="1500000000001"
-             period2_mode="days2" period2_param="31" period2_date="1500000000002"
-             period3_mode="days3" period3_param="32" period3_date="1500000000003"
-             period4_mode="days4" period4_param="33" period4_date="1500000000004"
-             period5_mode="days5" period5_param="34" period5_date="1500000000005"
-             depth="1" scope="DIR" qualifier="PAC" created_at="1403042400000" build_date="1500000000006"
-             version="2.1-SNAPSHOT" path="1.2."/>
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="uuid_3"
+             parent_snapshot_id="2"
+             root_component_uuid="uuid_1"
+             root_snapshot_id="1"
+             status="P"
+             islast="[true]"
+             purge_status="1"
+             period1_mode="days1"
+             period1_param="30"
+             period1_date="1500000000001"
+             period2_mode="days2"
+             period2_param="31"
+             period2_date="1500000000002"
+             period3_mode="days3"
+             period3_param="32"
+             period3_date="1500000000003"
+             period4_mode="days4"
+             period4_param="33"
+             period4_date="1500000000004"
+             period5_mode="days5"
+             period5_param="34"
+             period5_date="1500000000005"
+             depth="1"
+             scope="DIR"
+             qualifier="PAC"
+             created_at="1403042400000"
+             build_date="1500000000006"
+             version="2.1-SNAPSHOT"
+             path="1.2."/>
 
 </dataset>
index 9ba70bee6f45f49848cc976913e34a037634a097..960bc8be6148e7f23cae7313f30f22427fc7a878 100644 (file)
@@ -5,7 +5,10 @@
             uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="."
             description="the description" long_name="Apache Struts"
             enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]" authorization_updated_at="[null]" />
-  <snapshots id="1" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
+  <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]"
              period5_mode="[null]" period5_param="[null]" period5_date="[null]"
              depth="[null]" scope="PRJ" qualifier="TRK" created_at="1228222680000" build_date="1228222680000"
              version="[null]" path=""/>
-  <snapshots id="10" project_id="1" parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
+  <snapshots id="10"
+             uuid="u10"
+             project_id="1"
+             parent_snapshot_id="[null]" root_project_id="1" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]"
@@ -29,7 +35,9 @@
             uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
             scope="PRJ" qualifier="BRC" long_name="Struts Core"
             description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" />
-  <snapshots id="2" project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1"
+  <snapshots id="2"
+             uuid="u2"
+             project_id="2" parent_snapshot_id="1" root_project_id="1" root_snapshot_id="1"
              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]"
             uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH."
             scope="PRJ" qualifier="BRC" long_name="Struts Data"
             description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" authorization_updated_at="[null]" />
-  <snapshots id="3" project_id="3" parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1"
+  <snapshots id="3"
+             uuid="u3"
+             project_id="3"
+             parent_snapshot_id="2" root_project_id="1" root_snapshot_id="1"
              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]"
             name="src/org/struts" root_id="3"
             description="[null]"
             enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="src/org/struts" authorization_updated_at="[null]" />
-  <snapshots id="4" project_id="4" parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1"
+  <snapshots id="4"
+             uuid="u4"
+             project_id="4"
+             parent_snapshot_id="3" root_project_id="1" root_snapshot_id="1"
              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]"
             description="[null]"
             enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java" authorization_updated_at="[null]" />
 
-  <snapshots id="5" project_id="5" parent_snapshot_id="4" root_project_id="1" root_snapshot_id="1"
+  <snapshots id="5"
+             uuid="u5"
+             project_id="5"
+             parent_snapshot_id="4" root_project_id="1" root_snapshot_id="1"
              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]"
index 8a2c1fb2f95f7d6311b54522b2878b76aa8b3159..09070b3b182ba37f25b3cefa0dbb8fe447f555fb 100644 (file)
@@ -6,7 +6,9 @@
             enabled="[true]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"/>
 
   <!-- version 1.0 -->
-  <snapshots id="1000" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1000"
+             uuid="u1000"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
@@ -14,7 +16,9 @@
              status="P" islast="[false]" depth="0"/>
 
   <!-- version 1.1 -->
-  <snapshots id="1001" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1001"
+             uuid="u1001"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
@@ -22,7 +26,9 @@
              status="P" islast="[false]" depth="0"/>
 
   <!-- version 1.2-SNAPSHOT -->
-  <snapshots id="1002" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1002"
+             uuid="u1002"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
@@ -30,7 +36,9 @@
              status="P" islast="[false]" depth="0"/>
 
   <!-- version 1.2-SNAPSHOT, current analysis -->
-  <snapshots id="1003" purge_status="[null]" period1_mode="[null]" period1_param="[null]" period1_date="[null]" period2_mode="[null]" period2_param="[null]" period2_date="[null]"
+  <snapshots id="1003"
+             uuid="u1003"
+             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]"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
index d0d026f6e4ae59b72664214a4991a0abc804a1ed..57e173e018e5692443a1383aae6305ac3166aa23 100644 (file)
@@ -7,7 +7,10 @@
             enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]" path="[null]"
             authorization_updated_at="[null]"/>
 
-  <snapshots id="1" component_uuid="ABCD" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="ABCD"
+             parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="PRJ" qualifier="PAC" created_at="1228172400001" build_date="1317247200000"
              version="2.0-SNAPSHOT" path="1.2."/>
-  <snapshots id="2" component_uuid="ABCD" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3"
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="ABCD"
+             parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228172400002" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="3" component_uuid="ABCD" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3"
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="ABCD"
+             parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -42,7 +51,9 @@
             description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]"
             authorization_updated_at="[null]"/>
 
-  <snapshots id="4" component_uuid="EFGH" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3"
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="EFGH" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -52,7 +63,9 @@
              depth="1" scope="DIR" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
   <!-- Unprocessed snapshot -->
-  <snapshots id="5" component_uuid="EFGH" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3"
+  <snapshots id="5"
+             uuid="u5"
+             component_uuid="EFGH" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3"
              status="U" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -69,7 +82,9 @@
             description="[null]" enabled="[true]" language="[null]" copy_component_uuid="[null]" developer_uuid="[null]"
             authorization_updated_at="[null]"/>
 
-  <snapshots id="6" component_uuid="FGHI" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3"
+  <snapshots id="6"
+             uuid="u6"
+             component_uuid="FGHI" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="3"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
index b457f267b98aa841d7e34b20ab827be5f1aee48a..406fdf06983f9fe93ac58bd863c71413e755cef6 100644 (file)
@@ -1,13 +1,35 @@
 <dataset>
 
-  <snapshots id="3" component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="1"
-             status="P" islast="[true]" purge_status="1"
-             period1_mode="days1" period1_param="30" period1_date="1316815200000"
-             period2_mode="days2" period2_param="31" period2_date="1316901600000"
-             period3_mode="days3" period3_param="32" period3_date="1316988000000"
-             period4_mode="days4" period4_param="33" period4_date="1317074400000"
-             period5_mode="days5" period5_param="34" period5_date="1317160800000"
-             depth="1" scope="DIR" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
-             version="2.1-SNAPSHOT" path="1.2."/>
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="uuid_3"
+             parent_snapshot_id="2"
+             root_component_uuid="uuid_1"
+             root_snapshot_id="1"
+             status="P"
+             islast="[true]"
+             purge_status="1"
+             period1_mode="days1"
+             period1_param="30"
+             period1_date="1316815200000"
+             period2_mode="days2"
+             period2_param="31"
+             period2_date="1316901600000"
+             period3_mode="days3"
+             period3_param="32"
+             period3_date="1316988000000"
+             period4_mode="days4"
+             period4_param="33"
+             period4_date="1317074400000"
+             period5_mode="days5"
+             period5_param="34"
+             period5_date="1317160800000"
+             depth="1"
+             scope="DIR"
+             qualifier="PAC"
+             created_at="1228172400000"
+             build_date="1317247200000"
+             version="2.1-SNAPSHOT"
+             path="1.2."/>
 
 </dataset>
index b950190b9263750794054e2f41f6dcab927151d6..c67aeba2af94d42b6e0cc75da102c670921dccfe 100644 (file)
@@ -1,7 +1,9 @@
 <dataset>
 
   <!-- PROJECT_ID = 1 -->
-  <snapshots id="1" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="1"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -10,7 +12,9 @@
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="PRJ" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="2" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="3"
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="3"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -19,7 +23,9 @@
              period5_mode="days5" period5_param="34" period5_date="1317160800000"
              depth="1" scope="DIR" qualifier="PAC" created_at="1228172400000" build_date="1317247200000"
              version="2.1-SNAPSHOT" path="1.2."/>
-  <snapshots id="3" component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="3"
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="uuid_1" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="3"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
@@ -31,7 +37,9 @@
 
 
   <!-- PROJECT_ID = 2 -->
-  <snapshots id="4" component_uuid="uuid_2" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="3"
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="uuid_2" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="3"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              version="2.1-SNAPSHOT" path="1.2."/>
 
   <!-- PROJECT_ID = 3 - no last snapshot -->
-  <snapshots id="5" component_uuid="uuid_3" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="3"
+  <snapshots id="5"
+             uuid="u5"
+             component_uuid="uuid_3"
+             parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="3"
              status="P" islast="[false]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
              version="2.1-SNAPSHOT" path="1.2."/>
 
   <!-- Child of snapshot id=1 -->
-  <snapshots id="6" component_uuid="uuid_55" parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="1"
+  <snapshots id="6"
+             uuid="u6"
+             component_uuid="uuid_55"
+             parent_snapshot_id="2" root_component_uuid="uuid_1" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="1"
              period1_mode="days1" period1_param="30" period1_date="1316815200000"
              period2_mode="days2" period2_param="31" period2_date="1316901600000"
index 797be8db59dae00534759dde2fd399710a3ed4ae..61362f40909f1a0c4a700c540134ded1b09bf7a2 100644 (file)
@@ -1,7 +1,17 @@
 <dataset>
 
-  <snapshots purge_status="[null]" id="1" status="U" islast="0" project_id="0"/>
-  <snapshots purge_status="[null]" id="2" status="U" islast="0" project_id="1"/>
+  <snapshots purge_status="[null]"
+             id="1"
+             uuid="u1"
+             status="U"
+             islast="0"
+             project_id="0"/>
+  <snapshots purge_status="[null]"
+             id="2"
+             uuid="u2"
+             status="U"
+             islast="0"
+             project_id="1"/>
   <projects id="1" uuid="1" kee="foo" enabled="1" scope="FIL" qualifier="CLA"/>
 
   <duplications_index id="1" project_snapshot_id="1" snapshot_id="2" hash="bb" index_in_file="0" start_line="1"
index 02a6e33afa776e3fe7bf5b29857dad9f754790f3..b34f689f680140e80cf668b9e79ab6c641678366 100644 (file)
@@ -1,7 +1,19 @@
 <dataset>
 
-  <snapshots purge_status="[null]" id="1" status="U" islast="0" component_uuid="0" root_component_uuid="0"/>
-  <snapshots purge_status="[null]" id="2" status="U" islast="0" component_uuid="uuid_1" root_component_uuid="uuid_1"/>
+  <snapshots purge_status="[null]"
+             id="1"
+             uuid="u1"
+             status="U"
+             islast="0"
+             component_uuid="0"
+             root_component_uuid="0"/>
+  <snapshots purge_status="[null]"
+             id="2"
+             uuid="u2"
+             status="U"
+             islast="0"
+             component_uuid="uuid_1"
+             root_component_uuid="uuid_1"/>
   <projects id="1" uuid="uuid_1" root_uuid="uuid_root" kee="foo" enabled="1" scope="FIL" qualifier="CLA"/>
 
 </dataset>
index d2eca3604881dc290d997ba3b040726eb5f14625..32b73f94ea439bc084412a87131100ef38d8ed80 100644 (file)
@@ -1,26 +1,48 @@
 <dataset>
 
-  <snapshots id="1" component_uuid="uuid_1" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
-  <snapshots id="2" component_uuid="uuid_1" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="uuid_1" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="uuid_1" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
   <projects id="1" uuid="uuid_1" root_uuid="uuid_root" kee="bar-old" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/>
 
-  <snapshots id="3" component_uuid="uuid_2" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/>
-  <snapshots id="4" component_uuid="uuid_2" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/>
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="uuid_2" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/>
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="uuid_2" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/>
   <projects id="2" uuid="uuid_2" root_uuid="uuid_root" kee="bar-last" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/>
 
-  <snapshots id="5" component_uuid="uuid_3" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
-  <snapshots id="6" component_uuid="uuid_3" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
+  <snapshots id="5"
+             uuid="u5"
+             component_uuid="uuid_3" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
+  <snapshots id="6"
+             uuid="u6"
+             component_uuid="uuid_3" status="P" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
   <projects id="3" uuid="uuid_3" root_uuid="uuid_root" kee="foo-old" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/>
 
-  <snapshots id="7" component_uuid="uuid_4" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/>
-  <snapshots id="8" component_uuid="uuid_4" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/>
+  <snapshots id="7"
+             uuid="u7"
+             component_uuid="uuid_4" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/>
+  <snapshots id="8"
+             uuid="u8"
+             component_uuid="uuid_4" status="P" islast="[true]" purge_status="[null]" root_component_uuid="uuid_1"/>
   <projects id="4" uuid="uuid_4" root_uuid="uuid_root" kee="foo-last" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/>
 
-  <snapshots id="9" component_uuid="uuid_5" status="U" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
-  <snapshots id="10" component_uuid="uuid_5" status="U" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
+  <snapshots id="9"
+             uuid="u9"
+             component_uuid="uuid_5" status="U" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
+  <snapshots id="10"
+             uuid="u10"
+             component_uuid="uuid_5" status="U" islast="[false]" purge_status="[null]" root_component_uuid="uuid_1"/>
   <projects id="5" uuid="uuid_5" root_uuid="uuid_root" kee="foo" enabled="[true]" scope="FIL" qualifier="CLA" language="java"/>
 
-  <snapshots id="11" component_uuid="uuid_6" purge_status="[null]" status="P" islast="1" root_component_uuid="uuid_1"/>
+  <snapshots id="11"
+             uuid="u11"
+             component_uuid="uuid_6" purge_status="[null]" status="P" islast="1" root_component_uuid="uuid_1"/>
   <projects id="6" uuid="uuid_6" root_uuid="uuid_root" kee="baz" enabled="[true]" scope="FIL" qualifier="CLA" language="grvy"/>
 
   <!-- Old snapshot of another project -->
index ab4473adb1be4dc1db6f75bad32c32cd570e1200..68405f0b92605bebab0136410658010c620a8fa6 100644 (file)
 
 
   <!-- snapshots -->
-  <snapshots id="1000" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
+  <snapshots id="1000"
+             uuid="u1000"
+             component_uuid="ABCD"
+             parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="1225544280000" build_date="1225544280000" version="[null]" path=""
              status="P" islast="[false]" depth="0"/>
-  <snapshots id="1001" component_uuid="BCDE" parent_snapshot_id="1000" root_component_uuid="ABCD" root_snapshot_id="1000"
+  <snapshots id="1001"
+             uuid="u1001"
+             component_uuid="BCDE" parent_snapshot_id="1000" root_component_uuid="ABCD" root_snapshot_id="1000"
              scope="DIR" qualifier="PAC" created_at="1225544280000" build_date="1225544280000" version="[null]" path="1000."
              status="P" islast="[false]" depth="1"/>
-  <snapshots id="1002" component_uuid="CDEF" parent_snapshot_id="1001" root_component_uuid="ABCD" root_snapshot_id="1000"
+  <snapshots id="1002"
+             uuid="u1002"
+             component_uuid="CDEF" parent_snapshot_id="1001" root_component_uuid="ABCD" root_snapshot_id="1000"
              scope="FIL" qualifier="CLA" created_at="1225544280000" build_date="1225544280000" version="[null]" path="1000.1001."
              status="P" islast="[false]" depth="2"/>
 
index 55744741a7f19ec8eb137035eeb4fac4803645c3..6645b79f2bf8d1cbc9926df17573e4c1d62cf09a 100644 (file)
@@ -8,7 +8,9 @@
             enabled="[true]"/>
 
   <!-- snapshots -->
-  <snapshots id="1000" component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
+  <snapshots id="1000"
+             uuid="u1000"
+             component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              scope="PRJ" qualifier="TRK" created_at="1225544280000" build_date="1225544280000" version="[null]" path=""
              status="P" islast="[false]" depth="0"/>
 
index 67e0041837232364958b3d8f331a07c5574f4721..1de5d1f021bc7f73206f36a3643fffb1e3b8e0db 100644 (file)
@@ -6,7 +6,9 @@
 
   <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]" uuid="FILE1" root_uuid="ABCD"/>
 
-  <snapshots id="5" component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]" />
+  <snapshots id="5"
+             uuid="u5"
+             component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]" />
 
   <project_measures id="20" snapshot_id="5" metric_id="10" value="[null]" text_value="0123456789012345678901234567890123456789" measure_data="[null]"
                     variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
index 08a654e1d89321d7cf91849a45a065ba22636913..0c3500551fc94e479ceb6422ea4e6707aeb3bb60 100644 (file)
@@ -6,7 +6,11 @@
 
   <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]" uuid="ABCD" root_uuid="ABCD"/>
 
-  <snapshots id="5" component_uuid="ABCD" root_component_uuid="ABCD" islast="[true]" />
+  <snapshots id="5"
+             uuid="u5"
+             component_uuid="ABCD"
+             root_component_uuid="ABCD"
+             islast="[true]" />
 
   <project_measures id="20"
                     component_uuid="ABCD"
index d58ef14ab2ee8cb4387d3a24b40807e25fc09cff..eb696790caca801f1d0a9b790cbb521a7f018d55 100644 (file)
@@ -7,7 +7,10 @@
   <projects id="1" kee="org.struts:struts-core:src/org/struts/RequestContext.java" enabled="[true]" uuid="uuid_1" root_uuid="uuid_1"/>
   <projects id="333" kee="dev:John-Doe" enabled="[true]" uuid="333" root_uuid="333"/>
 
-  <snapshots id="5" component_uuid="uuid_1" islast="[true]" root_component_uuid="uuid_1"/>
+  <snapshots id="5"
+             uuid="u5"
+             component_uuid="uuid_1"
+             islast="[true]" root_component_uuid="uuid_1"/>
 
   <project_measures id="20" snapshot_id="5" metric_id="10" value="[null]" text_value="0123456789012345678901234567890123456789" measure_data="[null]"
                     variation_value_1="[null]" variation_value_2="[null]" variation_value_3="[null]" variation_value_4="[null]" variation_value_5="[null]"
index fa242513c85762064adcd29080d401dea75a4319..eaea6445456f3cea3ba5efb5d9075231f7b823b0 100644 (file)
@@ -4,7 +4,10 @@
             long_name="[null]" scope="PRJ" qualifier="TRK" kee="project" name="project"
             description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"/>
 
-  <snapshots id="1" component_uuid="uuid_1" parent_snapshot_id="[null]" root_component_uuid="uuid_1" root_snapshot_id="[null]"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="uuid_1"
+             parent_snapshot_id="[null]" root_component_uuid="uuid_1" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]"
index fe50ae405d7e13a7e7c823dcf610520c96e0acb9..d3ca84c438da44d0c62611671a639a318a1ba3a8 100644 (file)
@@ -1,7 +1,9 @@
 <dataset>
 
   <!-- snapshot to keep -->
-  <snapshots id="1" parent_snapshot_id="[null]" component_uuid="uuid_1" root_component_uuid="uuid_1" root_snapshot_id="[null]"
+  <snapshots id="1"
+             uuid="u1"
+             parent_snapshot_id="[null]" component_uuid="uuid_1" root_component_uuid="uuid_1" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]"
index f8f8dc3055a341133bf0f4c3d04f0d97f5c7cd35..a4330d00591c6577b108d44d32c316ddc1ffb0ea 100644 (file)
@@ -1,7 +1,9 @@
 <dataset>
 
   <!-- snapshot to keep -->
-  <snapshots id="1"  parent_snapshot_id="[null]" component_uuid="uuid_1" root_component_uuid="uuid_1" root_snapshot_id="[null]"
+  <snapshots id="1"
+             uuid="u1"
+             parent_snapshot_id="[null]" component_uuid="uuid_1" root_component_uuid="uuid_1" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]"
@@ -28,7 +30,9 @@
 
 
   <!-- snapshot to remove, id 5 on resource 5-->
-  <snapshots id="5" component_uuid="uuid_5" parent_snapshot_id="[null]" root_component_uuid="uuid_5" root_snapshot_id="[null]"
+  <snapshots id="5"
+             uuid="u5"
+             component_uuid="uuid_5" parent_snapshot_id="[null]" root_component_uuid="uuid_5" 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]"
index a90f9929879ba5c75c6acdb448fb60b2413304e1..8532d9c55847e51e5398cb97a8af646c5f29982a 100644 (file)
@@ -11,6 +11,7 @@
            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]"
index 4fd5023f74e5baa065ad11e426435aa7f00c4b06..24dc9ac4a3b98c564615cab1c9c8927356020e5d 100644 (file)
            direction="1" hidden="[false]"/>
 
   <snapshots id="1"
-             component_uuid="uuid_1" parent_snapshot_id="[null]" root_component_uuid="uuid_1" root_snapshot_id="[null]"
-             status="P" islast="[true]" purge_status="[null]"
+             uuid="u1"
+             component_uuid="uuid_1"
+             parent_snapshot_id="[null]"
+             root_component_uuid="uuid_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]"
index 1933ad4f216a9b9b7d176c7ec1cba69b84172bb8..4ac3b5f57074ffe94363b031f5895fe9fa7b12aa 100644 (file)
@@ -9,6 +9,7 @@ Note that measures, events and reviews are not deleted.
 -->
 <dataset>
   <snapshots id="1"
+             uuid="u1"
              component_uuid="uuid_1" parent_snapshot_id="[null]" root_component_uuid="uuid_1" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -45,6 +46,7 @@ Note that measures, events and reviews are not deleted.
 
   <!-- The following is not purged but is kept for DBUnit -->
   <snapshots id="2"
+             uuid="u2"
              component_uuid="uuid_2" parent_snapshot_id="[null]" root_component_uuid="uuid_2" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index a4b06bcc31ebf15dac3ccfd42d6dd1138bfcbb51..54feba39511e081ab9d52b5d879aa1157e149466 100644 (file)
@@ -1,6 +1,7 @@
 <dataset>
 
   <snapshots id="1"
+             uuid="u1"
              component_uuid="uuid_1" parent_snapshot_id="[null]" root_component_uuid="uuid_1" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -31,7 +32,9 @@
 
   <!-- The following is not purged but is kept for DBUnit -->
   <snapshots id="2"
-             component_uuid="uuid_2" parent_snapshot_id="[null]" root_component_uuid="uuid_2" root_snapshot_id="[null]"
+             uuid="u2"
+             component_uuid="uuid_2"
+             parent_snapshot_id="[null]" root_component_uuid="uuid_2" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]"
index 01da01c229ed7f4243feb7a8228ebeb01c0c9bdb..1683404aa7902718660dcb5858dee3c3b6504495 100644 (file)
@@ -28,6 +28,7 @@
             deprecated_kee="[null]" authorization_updated_at="[null]"/>
 
   <snapshots id="1"
+             uuid="u1"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -39,6 +40,7 @@
              build_date="1228222680000" version="[null]" path="[null]"/>
 
   <snapshots id="2"
+             uuid="u2"
              component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -50,6 +52,7 @@
              build_date="1228222680000" version="[null]" path="[null]"/>
 
   <snapshots id="3"
+             uuid="u3"
              component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -62,6 +65,7 @@
 
   <!-- isLast is true, don't want to delete associated source lines -->
   <snapshots id="4"
+             uuid="u4"
              component_uuid="KLMN" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 157ac6440f98ed743c3454ffc8c42361a32af3d9..0a2d184a76269057775d857bdfc27448805ee884 100644 (file)
@@ -30,6 +30,7 @@ What has been changed :
             deprecated_kee="[null]" authorization_updated_at="[null]"/>
 
   <snapshots id="1"
+             uuid="u1"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -41,6 +42,7 @@ What has been changed :
              build_date="1228222680000" version="[null]" path="[null]"/>
 
   <snapshots id="2"
+             uuid="u2"
              component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -53,6 +55,7 @@ What has been changed :
 
 
   <snapshots id="3"
+             uuid="u3"
              component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index e252c3f9689c9a97f61ee9fbe534fb96b961741c..09ad267ff547d5761e40f6feb461b16ef0867d7e 100644 (file)
@@ -22,6 +22,7 @@
             deprecated_kee="[null]" authorization_updated_at="[null]"/>
 
   <snapshots id="1"
+             uuid="u1"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -33,6 +34,7 @@
              version="[null]" path="[null]"/>
 
   <snapshots id="2"
+             uuid="u2"
              component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -45,6 +47,7 @@
 
 
   <snapshots id="3"
+             uuid="u3"
              component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index ade3fd7d21ecb584fda1bc907f097d593cdc6ec2..c9f3cff3536f4f642415e32e68d65472ba097b0e 100644 (file)
@@ -14,6 +14,7 @@ Snapshot 2 has been deleted
 
   <!-- past snapshot with status "processed" and already purged -->
   <snapshots id="1"
+             uuid="u1"
              component_uuid="projectUUID" parent_snapshot_id="[null]" root_component_uuid="projectUUID" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -26,6 +27,7 @@ Snapshot 2 has been deleted
 
   <!-- snapshot with status "processed" and flagged as "last" -> do not purge and do not delete -->
   <snapshots id="3"
+             uuid="u3"
              component_uuid="projectUUID" parent_snapshot_id="[null]" root_component_uuid="projectUUID" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="0"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 9d795b7ea83c9dfec4c8643a1db4eb42f772eb01..0628262478df793e6d6a0d4dd82f32d07cd35bcd 100644 (file)
@@ -9,6 +9,7 @@
 
   <!-- past snapshot with status "processed" and already purged -->
   <snapshots id="1"
+             uuid="u1"
              component_uuid="projectUUID" parent_snapshot_id="[null]" root_component_uuid="projectUUID" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -21,6 +22,7 @@
 
   <!-- snapshot with status "unprocessed" -> to be deleted -->
   <snapshots id="2"
+             uuid="u2"
              component_uuid="projectUUID" parent_snapshot_id="[null]" root_component_uuid="projectUUID" root_snapshot_id="[null]"
              status="U" islast="[false]" purge_status="0"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -33,6 +35,7 @@
 
   <!-- snapshot with status "processed" and flagged as "last" -> do not purge and do not delete -->
   <snapshots id="3"
+             uuid="u3"
              component_uuid="projectUUID" parent_snapshot_id="[null]" root_component_uuid="projectUUID" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="0"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 13c0421196292dd96b2f632378cd47600fd2dbd0..1a5eced40d75b61a94b8be24fb08e0e4e63580a2 100644 (file)
@@ -29,6 +29,7 @@ What has been changed : purge_status=1 on snapshot 4 (PRJ) and snapshots 5 and 6
 
   <!-- do not purge last snapshots -->
   <snapshots id="1"
+             uuid="u1"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -40,6 +41,7 @@ What has been changed : purge_status=1 on snapshot 4 (PRJ) and snapshots 5 and 6
              version="[null]" path="[null]"/>
 
   <snapshots id="2"
+             uuid="u2"
              component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -52,6 +54,7 @@ What has been changed : purge_status=1 on snapshot 4 (PRJ) and snapshots 5 and 6
 
 
   <snapshots id="3"
+             uuid="u3"
              component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -64,6 +67,7 @@ What has been changed : purge_status=1 on snapshot 4 (PRJ) and snapshots 5 and 6
 
   <!-- snapshots to be purged -->
   <snapshots id="4"
+             uuid="u4"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 52ea5d63dee9faadbbe646c6e7abbcf9a6179b45..0e92ef653ca17a1af5ecb24432595529fdbc1083 100644 (file)
@@ -23,6 +23,7 @@
 
   <!-- do not purge last snapshots -->
   <snapshots id="1"
+             uuid="u1"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -34,6 +35,7 @@
              version="[null]" path="[null]"/>
 
   <snapshots id="2"
+             uuid="u2"
              component_uuid="EFGH" parent_snapshot_id="1" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -46,6 +48,7 @@
 
 
   <snapshots id="3"
+             uuid="u3"
              component_uuid="GHIJ" parent_snapshot_id="2" root_component_uuid="ABCD" root_snapshot_id="1"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -58,6 +61,7 @@
 
   <!-- snapshots to be purged -->
   <snapshots id="4"
+             uuid="u4"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -69,6 +73,7 @@
              version="[null]" path="[null]"/>
 
   <snapshots id="5"
+             uuid="u5"
              component_uuid="EFGH" parent_snapshot_id="4" root_component_uuid="ABCD" root_snapshot_id="4"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -81,6 +86,7 @@
 
 
   <snapshots id="6"
+             uuid="u6"
              component_uuid="GHIJ" parent_snapshot_id="5" root_component_uuid="ABCD" root_snapshot_id="4"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index fb03c68f429a7a028d0f5c0f19d84afdb7e856eb..82e551454dd959ae3fe4b8a8f9cdc9066c71bfc6 100644 (file)
@@ -7,7 +7,9 @@
             description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"
             authorization_updated_at="[null]"/>
 
-  <snapshots id="1" component_uuid="A" parent_snapshot_id="[null]" root_component_uuid="A" root_snapshot_id="[null]"
+  <snapshots id="1"
+             uuid="u1"
+             component_uuid="A" parent_snapshot_id="[null]" root_component_uuid="A" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]"
@@ -58,7 +60,9 @@
             description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"
             authorization_updated_at="[null]"/>
 
-  <snapshots id="2" component_uuid="B" parent_snapshot_id="1" root_component_uuid="A" root_snapshot_id="1"
+  <snapshots id="2"
+             uuid="u2"
+             component_uuid="B" parent_snapshot_id="1" root_component_uuid="A" root_snapshot_id="1"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
              period2_mode="[null]" period2_param="[null]" period2_date="[null]"
@@ -76,7 +80,9 @@
             description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"
             authorization_updated_at="[null]"/>
 
-  <snapshots id="3" component_uuid="C" parent_snapshot_id="1" root_component_uuid="A" root_snapshot_id="1"
+  <snapshots id="3"
+             uuid="u3"
+             component_uuid="C" parent_snapshot_id="1" root_component_uuid="A" root_snapshot_id="1"
              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]"
             description="[null]" language="java" copy_component_uuid="[null]" developer_uuid="[null]"
             authorization_updated_at="[null]"/>
 
-  <snapshots id="4" component_uuid="D" parent_snapshot_id="3" root_component_uuid="A" root_snapshot_id="1"
+  <snapshots id="4"
+             uuid="u4"
+             component_uuid="D" parent_snapshot_id="3" root_component_uuid="A" root_snapshot_id="1"
              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]"
index b4e6316d26a8f8a3ecfa30051dbe1e366f4ac82a..0a3624676c9980c4215e2dadab405cfbdf5f5a4a 100644 (file)
@@ -2,6 +2,7 @@
 
   <!-- do not delete if islast=true -->
   <snapshots id="1"
+             uuid="u1"
              component_uuid="P1" parent_snapshot_id="[null]" root_component_uuid="P1" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -14,6 +15,7 @@
 
   <!-- delete only resource 1 -->
   <snapshots id="2"
+             uuid="u2"
              component_uuid="uuid_2" parent_snapshot_id="1" root_component_uuid="P1" root_snapshot_id="1"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 3f61d3bdbabbc2f1b1aeb74e4afdfdf77ba80405..ff7ab3066f42c755e7c561c13288db88eab37aeb 100644 (file)
@@ -2,6 +2,7 @@
 
   <!-- do not delete if islast=true -->
   <snapshots id="1"
+             uuid="u1"
              component_uuid="P1" parent_snapshot_id="[null]" root_component_uuid="P1" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -14,6 +15,7 @@
 
   <!-- delete only resource 1 -->
   <snapshots id="2"
+             uuid="u2"
              component_uuid="uuid_2" parent_snapshot_id="1" root_component_uuid="P1" root_snapshot_id="1"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -26,6 +28,7 @@
 
   <!-- to be deleted -->
   <snapshots id="3"
+             uuid="u3"
              component_uuid="P1" parent_snapshot_id="[null]" root_component_uuid="P1" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 3f85b38406c3a30083d548f1206ecc7d29c100a6..ecc8320e77ff762a95f440e9aa24cf5c2fa93b35 100644 (file)
@@ -11,6 +11,7 @@
 
   <!-- snapshot already purged -->
   <snapshots id="1"
+             uuid="u1"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -24,6 +25,7 @@
 
   <!-- do not purge snapshot with islast=true-->
   <snapshots id="2"
+             uuid="u2"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -36,6 +38,7 @@
 
   <!-- snapshot to be purged -->
   <snapshots id="3"
+             uuid="u3"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 6d59eb0ff868987d0d21ae1683b42cb328db85b7..33fed020f2ed816563a13da0589256e2f5bb72d3 100644 (file)
@@ -11,6 +11,7 @@
 
   <!-- snapshot already purged -->
   <snapshots id="1"
+             uuid="u1"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="1"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -24,6 +25,7 @@
 
   <!-- do not purge snapshot with islast=true-->
   <snapshots id="2"
+             uuid="u2"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -36,6 +38,7 @@
 
   <!-- snapshot to be purged -->
   <snapshots id="3"
+             uuid="u3"
              component_uuid="ABCD" parent_snapshot_id="[null]" root_component_uuid="ABCD" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 290485d8094f6cb58a08d4ad744cabb798b7a91e..7f1a90e23b8f655c8655f4766f3f3a025acb98d8 100644 (file)
@@ -2,6 +2,7 @@
 
   <!-- last -> select -->
   <snapshots id="1"
+             uuid="u1"
              component_uuid="P1" parent_snapshot_id="[null]" root_component_uuid="P1" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -14,6 +15,7 @@
 
   <!-- not processed -> exclude -->
   <snapshots id="2"
+             uuid="u2"
              component_uuid="P1" parent_snapshot_id="[null]" root_component_uuid="P1" root_snapshot_id="[null]"
              status="U" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -26,6 +28,7 @@
 
   <!-- on other resource -> exclude -->
   <snapshots id="3"
+             uuid="u3"
              component_uuid="uuid_222" parent_snapshot_id="[null]" root_component_uuid="uuid_222" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -38,6 +41,7 @@
 
   <!-- without event -> select -->
   <snapshots id="4"
+             uuid="u4"
              component_uuid="P1" parent_snapshot_id="[null]" root_component_uuid="P1" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
@@ -50,6 +54,7 @@
 
   <!-- with event -> select -->
   <snapshots id="5"
+             uuid="u5"
              component_uuid="P1" parent_snapshot_id="[null]" root_component_uuid="P1" root_snapshot_id="[null]"
              status="P" islast="[false]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index 89d73329dca681068433664ba4b167bc59a728bc..1c06545acc2890613131042d726850acae9f16b3 100644 (file)
@@ -11,6 +11,7 @@
             authorization_updated_at="[null]"/>
 
   <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]"
index 9e92f34618b19efc60c26370d306183d3c7fb34d..45d429f1f0abb005c58dcaccc469b7cbe3857403 100644 (file)
@@ -6,6 +6,7 @@
             authorization_updated_at="[null]"/>
 
   <snapshots id="1"
+             uuid="u1"
              component_uuid="1" parent_snapshot_id="[null]" root_component_uuid="1" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
index ab94caed6e51c28c6bea677fe7c29a6454de095e..75b4fb53a745935593e85cd3bd50032da23ef906 100644 (file)
@@ -6,6 +6,7 @@
             authorization_updated_at="[null]"/>
 
   <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]"
index 7735736555ad112a3b16556c3024d17568bf4d16..5227b4ca866a03be71f98adbe016983fa0e4396f 100644 (file)
@@ -6,6 +6,7 @@
             authorization_updated_at="[null]"/>
 
   <snapshots id="1"
+             uuid="u1"
              component_uuid="P1" parent_snapshot_id="[null]" root_component_uuid="P1" root_snapshot_id="[null]"
              status="P" islast="[true]" purge_status="[null]"
              period1_mode="[null]" period1_param="[null]" period1_date="[null]"
diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/AddComponentUuidColumnsToSnapshotsTest/old_snapshots.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/AddComponentUuidColumnsToSnapshotsTest/old_snapshots.sql
new file mode 100644 (file)
index 0000000..832463b
--- /dev/null
@@ -0,0 +1,32 @@
+CREATE TABLE "SNAPSHOTS" (
+  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  "CREATED_AT" BIGINT,
+  "BUILD_DATE" BIGINT,
+  "PROJECT_ID" INTEGER 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_PROJECT_ID" INTEGER,
+  "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
+);
diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/AddUuidColumnToSnapshotsTest/old_snapshots.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/AddUuidColumnToSnapshotsTest/old_snapshots.sql
new file mode 100644 (file)
index 0000000..d8e6c11
--- /dev/null
@@ -0,0 +1,32 @@
+CREATE TABLE "SNAPSHOTS" (
+  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  "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
+);
diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/AddUuidColumnsToSnapshotsTest/old_snapshots.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/AddUuidColumnsToSnapshotsTest/old_snapshots.sql
deleted file mode 100644 (file)
index 832463b..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-CREATE TABLE "SNAPSHOTS" (
-  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
-  "CREATED_AT" BIGINT,
-  "BUILD_DATE" BIGINT,
-  "PROJECT_ID" INTEGER 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_PROJECT_ID" INTEGER,
-  "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
-);
diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/MakeComponentUuidColumnsNotNullOnSnapshotsTest/in_progress_snapshots.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/MakeComponentUuidColumnsNotNullOnSnapshotsTest/in_progress_snapshots.sql
new file mode 100644 (file)
index 0000000..89c13c7
--- /dev/null
@@ -0,0 +1,34 @@
+CREATE TABLE "SNAPSHOTS" (
+  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  "CREATED_AT" BIGINT,
+  "BUILD_DATE" BIGINT,
+  "PROJECT_ID" INTEGER NOT NULL,
+  "COMPONENT_UUID" VARCHAR(50),
+  "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_PROJECT_ID" INTEGER,
+  "ROOT_COMPONENT_UUID" VARCHAR(50),
+  "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
+);
diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/MakeUuidColumnNotNullOnSnapshotsTest/in_progress_snapshots.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/MakeUuidColumnNotNullOnSnapshotsTest/in_progress_snapshots.sql
new file mode 100644 (file)
index 0000000..e87bc84
--- /dev/null
@@ -0,0 +1,34 @@
+CREATE TABLE "SNAPSHOTS" (
+  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  // NULLABLE
+  "UUID" VARCHAR(50),
+  "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
+);
diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/MakeUuidColumnsNotNullOnSnapshotsTest/in_progress_snapshots.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/MakeUuidColumnsNotNullOnSnapshotsTest/in_progress_snapshots.sql
deleted file mode 100644 (file)
index 89c13c7..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-CREATE TABLE "SNAPSHOTS" (
-  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
-  "CREATED_AT" BIGINT,
-  "BUILD_DATE" BIGINT,
-  "PROJECT_ID" INTEGER NOT NULL,
-  "COMPONENT_UUID" VARCHAR(50),
-  "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_PROJECT_ID" INTEGER,
-  "ROOT_COMPONENT_UUID" VARCHAR(50),
-  "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
-);
diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshotsTest/in_progress_snapshots_with_projects.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateComponentUuidColumnsOfSnapshotsTest/in_progress_snapshots_with_projects.sql
new file mode 100644 (file)
index 0000000..64128b7
--- /dev/null
@@ -0,0 +1,57 @@
+CREATE TABLE "SNAPSHOTS" (
+  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  "CREATED_AT" BIGINT,
+  "BUILD_DATE" BIGINT,
+  "PROJECT_ID" INTEGER NOT NULL,
+  "COMPONENT_UUID" VARCHAR(50),
+  "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_PROJECT_ID" INTEGER,
+  "ROOT_COMPONENT_UUID" VARCHAR(50),
+  "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 "PROJECTS" (
+  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  "KEE" VARCHAR(400),
+  "ROOT_ID" INTEGER,
+  "UUID" VARCHAR(50),
+  "PROJECT_UUID" VARCHAR(50),
+  "MODULE_UUID" VARCHAR(50),
+  "MODULE_UUID_PATH" VARCHAR(4000),
+  "NAME" VARCHAR(2000),
+  "DESCRIPTION" VARCHAR(2000),
+  "ENABLED" BOOLEAN NOT NULL DEFAULT TRUE,
+  "SCOPE" VARCHAR(3),
+  "QUALIFIER" VARCHAR(10),
+  "DEPRECATED_KEE" VARCHAR(400),
+  "PATH" VARCHAR(2000),
+  "LANGUAGE" VARCHAR(20),
+  "COPY_RESOURCE_ID" INTEGER,
+  "LONG_NAME" VARCHAR(2000),
+  "PERSON_ID" INTEGER,
+  "CREATED_AT" TIMESTAMP,
+  "AUTHORIZATION_UPDATED_AT" BIGINT
+);
diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateUuidColumnOnSnapshotsTest/in_progress_snapshots.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateUuidColumnOnSnapshotsTest/in_progress_snapshots.sql
new file mode 100644 (file)
index 0000000..e87bc84
--- /dev/null
@@ -0,0 +1,34 @@
+CREATE TABLE "SNAPSHOTS" (
+  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
+  // NULLABLE
+  "UUID" VARCHAR(50),
+  "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
+);
diff --git a/sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateUuidColumnsOfSnapshotsTest/in_progress_snapshots_with_projects.sql b/sonar-db/src/test/resources/org/sonar/db/version/v60/PopulateUuidColumnsOfSnapshotsTest/in_progress_snapshots_with_projects.sql
deleted file mode 100644 (file)
index 64128b7..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-CREATE TABLE "SNAPSHOTS" (
-  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
-  "CREATED_AT" BIGINT,
-  "BUILD_DATE" BIGINT,
-  "PROJECT_ID" INTEGER NOT NULL,
-  "COMPONENT_UUID" VARCHAR(50),
-  "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_PROJECT_ID" INTEGER,
-  "ROOT_COMPONENT_UUID" VARCHAR(50),
-  "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 "PROJECTS" (
-  "ID" INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1),
-  "KEE" VARCHAR(400),
-  "ROOT_ID" INTEGER,
-  "UUID" VARCHAR(50),
-  "PROJECT_UUID" VARCHAR(50),
-  "MODULE_UUID" VARCHAR(50),
-  "MODULE_UUID_PATH" VARCHAR(4000),
-  "NAME" VARCHAR(2000),
-  "DESCRIPTION" VARCHAR(2000),
-  "ENABLED" BOOLEAN NOT NULL DEFAULT TRUE,
-  "SCOPE" VARCHAR(3),
-  "QUALIFIER" VARCHAR(10),
-  "DEPRECATED_KEE" VARCHAR(400),
-  "PATH" VARCHAR(2000),
-  "LANGUAGE" VARCHAR(20),
-  "COPY_RESOURCE_ID" INTEGER,
-  "LONG_NAME" VARCHAR(2000),
-  "PERSON_ID" INTEGER,
-  "CREATED_AT" TIMESTAMP,
-  "AUTHORIZATION_UPDATED_AT" BIGINT
-);