mirror of
https://github.com/logseq/logseq.git
synced 2026-04-25 06:35:02 +00:00
add :logseq.kv/local-graph-uuid
This commit is contained in:
6
deps/db/src/logseq/db.cljs
vendored
6
deps/db/src/logseq/db.cljs
vendored
@@ -587,12 +587,14 @@
|
||||
|
||||
(def kv sqlite-util/kv)
|
||||
|
||||
;; TODO: why not generate a UUID for all local graphs?
|
||||
;; And prefer this local graph UUID when picking an ID for new rtc graph?
|
||||
(defn get-graph-rtc-uuid
|
||||
[db]
|
||||
(when db (get-key-value db :logseq.kv/graph-uuid)))
|
||||
|
||||
(defn get-graph-local-uuid
|
||||
[db]
|
||||
(when db (get-key-value db :logseq.kv/local-graph-uuid)))
|
||||
|
||||
(defn get-graph-schema-version
|
||||
[db]
|
||||
(when db (get-key-value db :logseq.kv/schema-version)))
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
:logseq.kv/graph-uuid {:doc "Store graph-uuid if it's a rtc enabled graph"
|
||||
:rtc {:rtc/ignore-entity-when-init-upload true
|
||||
:rtc/ignore-entity-when-init-download true}}
|
||||
:logseq.kv/local-graph-uuid {:doc "Store graph-uuid if it's a local graph"
|
||||
:rtc {:rtc/ignore-entity-when-init-upload true
|
||||
:rtc/ignore-entity-when-init-download true}}
|
||||
:logseq.kv/import-type {:doc "If graph is imported, identifies how a graph is imported including which UI or CLI import process. CLI scripts can set this to a custom value.
|
||||
UI values include :file-graph and :sqlite-db and CLI values start with :cli e.g. :cli/default."}
|
||||
:logseq.kv/imported-at {:doc "Time if graph is imported"}
|
||||
|
||||
@@ -237,7 +237,8 @@
|
||||
graph-git-sha
|
||||
(conj (sqlite-util/kv :logseq.kv/graph-git-sha graph-git-sha))
|
||||
true
|
||||
(conj (sqlite-util/kv :logseq.kv/graph-uuid (common-uuid/gen-uuid))))
|
||||
(conj (sqlite-util/kv :logseq.kv/local-graph-uuid
|
||||
(uuid (str "loc" (subs (str (common-uuid/gen-uuid)) 3))))))
|
||||
initial-files (build-initial-files config-content)
|
||||
{properties-tx :tx :keys [properties]} (build-initial-properties)
|
||||
db-ident->properties (zipmap (map :db/ident properties) properties)
|
||||
|
||||
Reference in New Issue
Block a user