Skip to content

Commit 11f7656

Browse files
fix: invalid graphs b/c of blocks with missing title
1 parent 638cb6e commit 11f7656

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

deps/db/test/logseq/db/sqlite/export_test.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@
645645
:file/content "// comment"}]}]
646646
original-data))
647647

648-
(deftest import-graph
648+
(deftest ^:focus import-graph
649649
(let [original-data (build-original-graph-data)
650650
conn (db-test/create-conn-with-blocks (dissoc original-data ::sqlite-export/graph-files))
651651
;; set to an unobtainable version to test this ident

src/main/frontend/worker/db/migrate.cljs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,6 +1025,10 @@
10251025
(and (ldb/class? entity) (nil? (:db/ident entity)))
10261026
[[:db/add (:db/id entity) :db/ident (db-class/create-user-class-ident-from-name (:block/title entity))]]
10271027

1028+
;; fix blocks missing title
1029+
(and (:block/parent entity) (nil? (:block/title entity)))
1030+
[[:db/add (:db/id entity) :block/title ""]]
1031+
10281032
(and (ldb/property? entity) (nil? (:db/ident entity)))
10291033
[[:db/add (:db/id entity) :db/ident (db-property/create-user-property-ident-from-name (:block/title entity))]]
10301034

0 commit comments

Comments
 (0)