From b7edc5cc9295b39be68a77cdca1692c0f9e2f7ab Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Wed, 29 Oct 2025 17:00:55 +0800 Subject: [PATCH] fix: hidden columns --- src/main/frontend/worker/db/validate.cljs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/worker/db/validate.cljs b/src/main/frontend/worker/db/validate.cljs index 82fdefed63..03e4d1fb80 100644 --- a/src/main/frontend/worker/db/validate.cljs +++ b/src/main/frontend/worker/db/validate.cljs @@ -117,10 +117,11 @@ [:db/add (:e d) new-db-ident (:v d)]]))))))))) ;; FIXME: :logseq.property.table/hidden-columns should be :property type to avoid issues like this hidden-columns-tx-data (->> (d/datoms db :avet :logseq.property.table/hidden-columns) - (keep (fn [d] - (when (re-find #"^(\d)" (name (:v d))) - (let [new-value (keyword (namespace (:v d)) (string/replace-first (name (:v d)) #"^(\d)" "NUM-$1"))] - [:db/add (:e d) (:a d) new-value]))))) + (mapcat (fn [d] + (when (re-find #"^(\d)" (name (:v d))) + (let [new-value (keyword (namespace (:v d)) (string/replace-first (name (:v d)) #"^(\d)" "NUM-$1"))] + [[:db/retract (:e d) (:a d) (:v d)] + [:db/add (:e d) (:a d) new-value]]))))) tx-data' (concat tx-data hidden-columns-tx-data)] (when (seq tx-data') (ldb/transact! conn tx-data'))))