fix: hidden columns

This commit is contained in:
Tienson Qin
2025-10-29 17:00:55 +08:00
parent de0d0cd17a
commit b7edc5cc92

View File

@@ -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'))))