Browse Source

fix: migration

Tienson Qin 9 months ago
parent
commit
7cda45eea9

+ 1 - 1
deps/db/src/logseq/db/frontend/schema.cljs

@@ -2,7 +2,7 @@
   "Main datascript schemas for the Logseq app"
   (:require [clojure.set :as set]))
 
-(def version 58)
+(def version 59)
 
 ;; A page is a special block, a page can corresponds to multiple files with the same ":block/name".
 (def ^:large-vars/data-var schema

+ 5 - 1
src/main/frontend/worker/db/migrate.cljs

@@ -660,8 +660,12 @@
                                      (fn [data [k existing-value]]
                                        (update data k
                                                (fn [v]
-                                                 (if (and (coll? v) (not (map? v)))
+                                                 (cond
+                                                   (and (vector? v) (= :block/uuid (first v)))
+                                                   v
+                                                   (and (coll? v) (not (map? v)))
                                                    (concat v (if (coll? existing-value) existing-value [existing-value]))
+                                                   :else
                                                    (if (some? existing-value) existing-value v)))))
                                      data
                                      existing-data)))