From 66eca9ba4a3054bef924355a51c8d7423ceb57bb Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 8 Feb 2024 12:19:44 +0100 Subject: [PATCH] :bug: Fix conflict on components path for v2 migration --- backend/src/app/features/components_v2.clj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/backend/src/app/features/components_v2.clj b/backend/src/app/features/components_v2.clj index f388046931..13e90d2541 100644 --- a/backend/src/app/features/components_v2.clj +++ b/backend/src/app/features/components_v2.clj @@ -55,6 +55,7 @@ [app.util.pointer-map :as pmap] [app.util.time :as dt] [buddy.core.codecs :as bc] + [clojure.set :refer [rename-keys]] [cuerdas.core :as str] [datoteka.io :as io] [promesa.exec :as px] @@ -995,6 +996,9 @@ [assets generic-name] (let [;; Group by first element of the path. groups (d/group-by #(first (cfh/split-path (:path %))) assets) + ;; If there is a group called as the generic-name we have to preserve it + unames (into #{} (keep str) (keys groups)) + groups (rename-keys groups {generic-name (cfh/generate-unique-name unames generic-name)}) ;; Split large groups in chunks of max-group-size elements groups (loop [groups (seq groups)