Browse Source

enhance: save graph's initial schema and created-at

With backups we're likely to have longer lived db graphs. Having this extra
data will be helpful for debugging and maybe migrations
Gabriel Horner 1 year ago
parent
commit
9f27f83f36
1 changed files with 2 additions and 0 deletions
  1. 2 0
      deps/db/src/logseq/db/sqlite/create_graph.cljs

+ 2 - 0
deps/db/src/logseq/db/sqlite/create_graph.cljs

@@ -106,6 +106,8 @@
   [config-content]
   (let [initial-data [(sqlite-util/kv :logseq.kv/db-type "db")
                       (sqlite-util/kv :logseq.kv/schema-version db-schema/version)
+                      (sqlite-util/kv :logseq.kv/graph-initial-schema-version db-schema/version)
+                      (sqlite-util/kv :logseq.kv/graph-created-at (common-util/time-ms))
                       ;; Empty property value used by db.type/ref properties
                       {:db/ident :logseq.property/empty-placeholder}
                       {:db/ident :logseq.class/Root}]