aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-02-12 11:20:11 +0100
committerJean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com>2015-02-13 14:39:06 +0100
commit33ad2136864fd9cb1143ab6524c9ef89810cc967 (patch)
tree74431b5a52edb2db608095099db63b87280719e8
parentc8ead9516ba9d040fe5b079f8289a87401a6a553 (diff)
downloadsonarqube-33ad2136864fd9cb1143ab6524c9ef89810cc967.tar.gz
sonarqube-33ad2136864fd9cb1143ab6524c9ef89810cc967.zip
SONAR-6119 Move module UUID path migration, include self on parents
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPath.java83
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/migrate_components-result.xml52
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/migrate_components.xml46
-rw-r--r--server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/not_migrate_already_migrated_components.xml50
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/db/migrate/790_update_projects_module_uuid_path.rb (renamed from server/sonar-web/src/main/webapp/WEB-INF/db/migrate/767_update_projects_module_uuid_path.rb)1
-rw-r--r--sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java2
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql2
7 files changed, 195 insertions, 41 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPath.java b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPath.java
index 468887c322b..9aba4c963a2 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPath.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPath.java
@@ -21,11 +21,9 @@
package org.sonar.server.db.migrations.v51;
import org.sonar.core.persistence.Database;
-import org.sonar.server.db.migrations.BaseDataChange;
-import org.sonar.server.db.migrations.MassUpdate;
+import org.sonar.server.db.migrations.*;
import org.sonar.server.db.migrations.MassUpdate.Handler;
import org.sonar.server.db.migrations.Select.Row;
-import org.sonar.server.db.migrations.SqlStatement;
import javax.annotation.Nullable;
@@ -33,6 +31,7 @@ import java.sql.SQLException;
/**
* SONAR-6054
+ * SONAR-6119
*/
public class UpdateProjectsModuleUuidPath extends BaseDataChange {
@@ -44,37 +43,65 @@ public class UpdateProjectsModuleUuidPath extends BaseDataChange {
@Override
public void execute(Context context) throws SQLException {
- MassUpdate update = context.prepareMassUpdate().rowPluralName("projects");
- update.select("SELECT p.id, p.module_uuid_path FROM projects p");
+ MassUpdate update = context.prepareMassUpdate().rowPluralName("components");
+ update.select("SELECT p.id, p.module_uuid_path, p.uuid, p.scope, p.qualifier FROM projects p");
update.update("UPDATE projects SET module_uuid_path=? WHERE id=?");
- update.execute(new Handler() {
- @Override
- public boolean handle(Row row, SqlStatement update) throws SQLException {
- Long id = row.getLong(1);
- String moduleUuidPath = row.getString(2);
- if (needUpdate(moduleUuidPath)) {
- update.setString(1, newModuleUuidPath(moduleUuidPath));
- update.setLong(2, id);
- return true;
- }
- return false;
- }
- });
+ update.execute(new ModuleUuidPathUpdateHandler());
}
- private static boolean needUpdate(@Nullable String moduleUuidPath) {
- return moduleUuidPath == null || !(moduleUuidPath.startsWith(SEP) && moduleUuidPath.endsWith(SEP));
- }
+ private static final class ModuleUuidPathUpdateHandler implements Handler {
+ @Override
+ public boolean handle(Row row, SqlStatement update) throws SQLException {
+ Long id = row.getLong(1);
+ String moduleUuidPath = row.getString(2);
+ String uuid = row.getString(3);
+ String scope = row.getString(4);
+ String qualifier = row.getString(5);
+
+ boolean needUpdate = false;
+ String newModuleUuidPath = moduleUuidPath;
+
+ if (needUpdateForSeparators(moduleUuidPath)) {
+ newModuleUuidPath = newModuleUuidPathWithSeparators(moduleUuidPath);
+ needUpdate = true;
+ }
+
+ if (needUpdateToIncludeItself(newModuleUuidPath, uuid, scope, qualifier)) {
+ newModuleUuidPath = newModuleUuidPathIncludingItself(newModuleUuidPath, uuid);
+ needUpdate = true;
+ }
+
+ if (needUpdate) {
+ update.setString(1, newModuleUuidPath);
+ update.setLong(2, id);
+ }
+ return needUpdate;
+ }
+
+ private static boolean needUpdateForSeparators(@Nullable String moduleUuidPath) {
+ return moduleUuidPath == null || !(moduleUuidPath.startsWith(SEP) && moduleUuidPath.endsWith(SEP));
+ }
- private static String newModuleUuidPath(@Nullable String oldModuleUuidPath) {
- if (oldModuleUuidPath == null || oldModuleUuidPath.isEmpty()) {
- return SEP;
- } else {
- StringBuilder newModuleUuidPath = new StringBuilder(oldModuleUuidPath);
- newModuleUuidPath.insert(0, SEP);
+ private static String newModuleUuidPathWithSeparators(@Nullable String oldModuleUuidPath) {
+ if (oldModuleUuidPath == null || oldModuleUuidPath.isEmpty()) {
+ return SEP;
+ } else {
+ StringBuilder newModuleUuidPath = new StringBuilder(oldModuleUuidPath);
+ newModuleUuidPath.insert(0, SEP);
+ newModuleUuidPath.append(SEP);
+ return newModuleUuidPath.toString();
+ }
+ }
+
+ private static boolean needUpdateToIncludeItself(String moduleUuidPath, @Nullable String uuid, @Nullable String scope, @Nullable String qualifier) {
+ return "PRJ".equals(scope) && !("DEV_PRJ".equals(qualifier)) && !(moduleUuidPath.contains(uuid));
+ }
+
+ private static String newModuleUuidPathIncludingItself(String moduleUuidPath, String uuid) {
+ StringBuilder newModuleUuidPath = new StringBuilder(moduleUuidPath);
+ newModuleUuidPath.append(uuid);
newModuleUuidPath.append(SEP);
return newModuleUuidPath.toString();
}
}
-
}
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/migrate_components-result.xml b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/migrate_components-result.xml
index 3f568ad6d41..86d58cac2e9 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/migrate_components-result.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/migrate_components-result.xml
@@ -2,21 +2,21 @@
<!-- root project -->
<projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" deprecated_kee="org.struts:struts"
- uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="."
+ uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
description="the description" long_name="Apache Struts"
enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
<!-- module -->
<projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" deprecated_kee="org.struts:struts-core"
- uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
+ 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_resource_id="[null]" person_id="[null]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
- <!-- sub module -->
+ <!-- sub module, already has dots: only itself appended -->
<projects id="3" root_id="1" kee="org.struts:struts-data" name="Struts Data" deprecated_kee="org.struts:struts-data"
- uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH."
+ 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_resource_id="[null]" person_id="[null]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
@@ -38,11 +38,53 @@
enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+ <!-- view -->
+ <projects id="6" root_id="[null]" scope="PRJ" qualifier="VW" kee="Teams" name="Teams" deprecated_kee="Teams"
+ uuid="MEAT" project_uuid="MEAT" module_uuid="[null]" module_uuid_path=".MEAT."
+ description="the description" long_name="Teams"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- sub-view -->
+ <projects id="7" root_id="6" scope="PRJ" qualifier="SVW" kee="Platform_Team" name="Platform Team" deprecated_kee="Platform_Team"
+ uuid="PLAT" project_uuid="MEAT" module_uuid="MEAT" module_uuid_path=".MEAT.PLAT."
+ description="the description" long_name="Platform Team"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- view technical project - unchanged -->
+ <projects id="8" root_id="6" scope="FIL" qualifier="TRK" kee="Platform_Team:sonarqube" name="SonarQube" deprecated_kee="Platform_Team:sonarqube"
+ uuid="SNQB" project_uuid="PLAT" module_uuid="PLAT" module_uuid_path=".MEAT.PLAT."
+ description="the description" long_name="Platform Team"
+ enabled="[true]" language="[null]" copy_resource_id="42" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- root project already has dots, appending itself -->
+ <projects id="9" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.sonar:sample" name="Sample" deprecated_kee="org.sonar:sample"
+ uuid="WDOT" project_uuid="WDOT" module_uuid="[null]" module_uuid_path=".WDOT."
+ description="the description" long_name="Sample"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
<!-- root project with module_uuid_path NULL -->
<projects id="10" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.sonar:sample" name="Sample" deprecated_kee="org.sonar:sample"
- uuid="DCBA" project_uuid="DCBA" module_uuid="[null]" module_uuid_path="."
+ uuid="DCBA" project_uuid="DCBA" module_uuid="[null]" module_uuid_path=".DCBA."
description="the description" long_name="Sample"
enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+ <!-- developer -->
+ <projects id="11" root_id="[null]" scope="PRJ" qualifier="DEV" kee="DEV:anakin.skywalker" name="Anakin Skywalker" deprecated_kee="DEV:anakin.skywalker"
+ uuid="VADR" project_uuid="VADR" module_uuid="[null]" module_uuid_path=".VADR."
+ description="the description" long_name="Anakin Skywalker"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="1" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- developer technical project, with dots - unchanged -->
+ <projects id="12" root_id="11" scope="PRJ" qualifier="DEV_PRJ" kee="DEV:anakin.skywalker:Executor" name="Executor Star Dreadnaught" deprecated_kee="DEV:anakin.skywalker:Executor"
+ uuid="EXCT" project_uuid="VADR" module_uuid="VADR" module_uuid_path=".VADR."
+ description="the description" long_name="Executor Star Dreadnaught"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/migrate_components.xml b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/migrate_components.xml
index 1a99736dfd9..355ec9308e7 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/migrate_components.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/migrate_components.xml
@@ -14,9 +14,9 @@
description="[null]" enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
- <!-- sub module -->
+ <!-- sub module, already has dots: only itself appended -->
<projects id="3" root_id="1" kee="org.struts:struts-data" name="Struts Data" deprecated_kee="org.struts:struts-data"
- uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path="ABCD.EFGH"
+ 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]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
@@ -38,6 +38,34 @@
enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+ <!-- view -->
+ <projects id="6" root_id="[null]" scope="PRJ" qualifier="VW" kee="Teams" name="Teams" deprecated_kee="Teams"
+ uuid="MEAT" project_uuid="MEAT" module_uuid="[null]" module_uuid_path=""
+ description="the description" long_name="Teams"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- sub-view -->
+ <projects id="7" root_id="6" scope="PRJ" qualifier="SVW" kee="Platform_Team" name="Platform Team" deprecated_kee="Platform_Team"
+ uuid="PLAT" project_uuid="MEAT" module_uuid="MEAT" module_uuid_path="MEAT"
+ description="the description" long_name="Platform Team"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- view technical project, already has dots - unchanged -->
+ <projects id="8" root_id="6" scope="FIL" qualifier="TRK" kee="Platform_Team:sonarqube" name="SonarQube" deprecated_kee="Platform_Team:sonarqube"
+ uuid="SNQB" project_uuid="PLAT" module_uuid="PLAT" module_uuid_path=".MEAT.PLAT."
+ description="the description" long_name="Platform Team"
+ enabled="[true]" language="[null]" copy_resource_id="42" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- root project already has dots, appending itself -->
+ <projects id="9" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.sonar:sample" name="Sample" deprecated_kee="org.sonar:sample"
+ uuid="WDOT" project_uuid="WDOT" module_uuid="[null]" module_uuid_path="."
+ description="the description" long_name="Sample"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
<!-- root project with module_uuid_path NULL -->
<projects id="10" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.sonar:sample" name="Sample" deprecated_kee="org.sonar:sample"
uuid="DCBA" project_uuid="DCBA" module_uuid="[null]" module_uuid_path="[null]"
@@ -45,4 +73,18 @@
enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+ <!-- developer -->
+ <projects id="11" root_id="[null]" scope="PRJ" qualifier="DEV" kee="DEV:anakin.skywalker" name="Anakin Skywalker" deprecated_kee="DEV:anakin.skywalker"
+ uuid="VADR" project_uuid="VADR" module_uuid="[null]" module_uuid_path=""
+ description="the description" long_name="Anakin Skywalker"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="1" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- developer technical project, with dots - unchanged -->
+ <projects id="12" root_id="11" scope="PRJ" qualifier="DEV_PRJ" kee="DEV:anakin.skywalker:Executor" name="Executor Star Dreadnaught" deprecated_kee="DEV:anakin.skywalker:Executor"
+ uuid="EXCT" project_uuid="VADR" module_uuid="VADR" module_uuid_path=".VADR."
+ description="the description" long_name="Executor Star Dreadnaught"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
</dataset>
diff --git a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/not_migrate_already_migrated_components.xml b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/not_migrate_already_migrated_components.xml
index 3f568ad6d41..4455653fdfd 100644
--- a/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/not_migrate_already_migrated_components.xml
+++ b/server/sonar-server/src/test/resources/org/sonar/server/db/migrations/v51/UpdateProjectsModuleUuidPathTest/not_migrate_already_migrated_components.xml
@@ -2,21 +2,21 @@
<!-- root project -->
<projects id="1" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.struts:struts" name="Struts" deprecated_kee="org.struts:struts"
- uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path="."
+ uuid="ABCD" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
description="the description" long_name="Apache Struts"
enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
<!-- module -->
<projects id="2" root_id="1" kee="org.struts:struts-core" name="Struts Core" deprecated_kee="org.struts:struts-core"
- uuid="EFGH" project_uuid="ABCD" module_uuid="[null]" module_uuid_path=".ABCD."
+ 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_resource_id="[null]" person_id="[null]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
<!-- sub module -->
<projects id="3" root_id="1" kee="org.struts:struts-data" name="Struts Data" deprecated_kee="org.struts:struts-data"
- uuid="FGHI" project_uuid="ABCD" module_uuid="EFGH" module_uuid_path=".ABCD.EFGH."
+ 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_resource_id="[null]" person_id="[null]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
@@ -38,11 +38,53 @@
enabled="[true]" language="java" copy_resource_id="[null]" person_id="[null]" path="src/org/struts/RequestContext.java"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+ <!-- view -->
+ <projects id="6" root_id="[null]" scope="PRJ" qualifier="VW" kee="Teams" name="Teams" deprecated_kee="Teams"
+ uuid="MEAT" project_uuid="MEAT" module_uuid="[null]" module_uuid_path=".MEAT."
+ description="the description" long_name="Teams"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- sub-view -->
+ <projects id="7" root_id="[null]" scope="PRJ" qualifier="SVW" kee="Platform_Team" name="Platform Team" deprecated_kee="Platform_Team"
+ uuid="PLAT" project_uuid="MEAT" module_uuid="MEAT" module_uuid_path=".MEAT.PLAT."
+ description="the description" long_name="Platform Team"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- view technical project, already has dots - unchanged -->
+ <projects id="8" root_id="[null]" scope="FIL" qualifier="TRK" kee="Platform_Team:sonarqube" name="SonarQube" deprecated_kee="Platform_Team:sonarqube"
+ uuid="SNQB" project_uuid="PLAT" module_uuid="PLAT" module_uuid_path=".MEAT.PLAT."
+ description="the description" long_name="Platform Team"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- root project already has dots, appending itself -->
+ <projects id="9" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.sonar:sample" name="Sample" deprecated_kee="org.sonar:sample"
+ uuid="WDOT" project_uuid="WDOT" module_uuid="[null]" module_uuid_path=".WDOT."
+ description="the description" long_name="Sample"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
<!-- root project with module_uuid_path NULL -->
<projects id="10" root_id="[null]" scope="PRJ" qualifier="TRK" kee="org.sonar:sample" name="Sample" deprecated_kee="org.sonar:sample"
- uuid="DCBA" project_uuid="DCBA" module_uuid="[null]" module_uuid_path="."
+ uuid="DCBA" project_uuid="DCBA" module_uuid="[null]" module_uuid_path=".DCBA."
description="the description" long_name="Sample"
enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+ <!-- developer -->
+ <projects id="11" root_id="[null]" scope="PRJ" qualifier="DEV" kee="DEV:anakin.skywalker" name="Anakin Skywalker" deprecated_kee="DEV:anakin.skywalker"
+ uuid="VADR" project_uuid="VADR" module_uuid="[null]" module_uuid_path=".VADR."
+ description="the description" long_name="Anakin Skywalker"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="1" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
+ <!-- developer technical project, with dots - unchanged -->
+ <projects id="12" root_id="11" scope="PRJ" qualifier="DEV_PRJ" kee="DEV:anakin.skywalker:Executor" name="Executor Star Dreadnaught" deprecated_kee="DEV:anakin.skywalker:Executor"
+ uuid="EXCT" project_uuid="VADR" module_uuid="VADR" module_uuid_path=".VADR."
+ description="the description" long_name="Executor Star Dreadnaught"
+ enabled="[true]" language="[null]" copy_resource_id="[null]" person_id="[null]" path="[null]"
+ created_at="2008-12-02 13:58:00.00" authorization_updated_at="[null]"/>
+
</dataset>
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/767_update_projects_module_uuid_path.rb b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/790_update_projects_module_uuid_path.rb
index ede79b41641..b25be54b77b 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/767_update_projects_module_uuid_path.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/db/migrate/790_update_projects_module_uuid_path.rb
@@ -21,6 +21,7 @@
#
# SonarQube 5.1
# SONAR-6054
+# SONAR-6117
#
class UpdateProjectsModuleUuidPath < ActiveRecord::Migration
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
index fc7327dbcb6..048e602afe9 100644
--- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
+++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java
@@ -33,7 +33,7 @@ import java.util.List;
*/
public class DatabaseVersion implements BatchComponent, ServerComponent {
- public static final int LAST_VERSION = 789;
+ public static final int LAST_VERSION = 790;
/**
* List of all the tables.n
diff --git a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
index eceb883ec31..af6b0b2df00 100644
--- a/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
+++ b/sonar-core/src/main/resources/org/sonar/core/persistence/rows-h2.sql
@@ -295,7 +295,6 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('763');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('764');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('765');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('766');
-INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('767');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('768');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('769');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('770');
@@ -317,6 +316,7 @@ INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('786');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('787');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('788');
INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('789');
+INSERT INTO SCHEMA_MIGRATIONS(VERSION) VALUES ('790');
INSERT INTO USERS(ID, LOGIN, NAME, EMAIL, CRYPTED_PASSWORD, SALT, CREATED_AT, UPDATED_AT, REMEMBER_TOKEN, REMEMBER_TOKEN_EXPIRES_AT) VALUES (1, 'admin', 'Administrator', '', 'a373a0e667abb2604c1fd571eb4ad47fe8cc0878', '48bc4b0d93179b5103fd3885ea9119498e9d161b', '1418215735482', '1418215735482', null, null);
ALTER TABLE USERS ALTER COLUMN ID RESTART WITH 2;