You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by sh...@apache.org on 2021/10/12 12:49:23 UTC
[unomi] branch UNOMI-516-migration-bug created (now 89eef28)
This is an automated email from the ASF dual-hosted git repository.
shuber pushed a change to branch UNOMI-516-migration-bug
in repository https://gitbox.apache.org/repos/asf/unomi.git.
at 89eef28 Fix bug in migration
This branch includes the following new commits:
new 89eef28 Fix bug in migration
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[unomi] 01/01: Fix bug in migration
Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
shuber pushed a commit to branch UNOMI-516-migration-bug
in repository https://gitbox.apache.org/repos/asf/unomi.git
commit 89eef2893417d69ea06f7f160209607824e69be5
Author: Serge Huber <sh...@jahia.com>
AuthorDate: Tue Oct 12 14:49:17 2021 +0200
Fix bug in migration
---
.../java/org/apache/unomi/shell/migration/impl/MigrationTo150.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/impl/MigrationTo150.java b/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/impl/MigrationTo150.java
index 03c377e..54da2f5 100644
--- a/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/impl/MigrationTo150.java
+++ b/tools/shell-commands/src/main/java/org/apache/unomi/shell/migration/impl/MigrationTo150.java
@@ -259,7 +259,11 @@ public class MigrationTo150 implements Migration {
mappings.put("dynamic_templates", newTypeMappings.getJSONArray("dynamic_templates"));
}
if (newTypeMappings.has("properties")) {
- mappings.put("properties", getMergedPropertyMappings(mappings.getJSONObject("properties"), newTypeMappings.getJSONObject("properties")));
+ if (mappings.has("properties")) {
+ mappings.put("properties", getMergedPropertyMappings(mappings.getJSONObject("properties"), newTypeMappings.getJSONObject("properties")));
+ } else {
+ mappings.put("properties", newTypeMappings.getJSONObject("properties"));
+ }
}
return new JSONObject().put("mappings", mappings);
}