fix: db kv id always resolves to -1

This commit is contained in:
Tienson Qin
2023-12-11 21:36:22 +08:00
parent dc53b78a37
commit 41bd5ac74d
2 changed files with 3 additions and 3 deletions

View File

@@ -83,8 +83,8 @@
(swap! conns dissoc (datascript-db repo)))
(defn kv
[key value]
{:db/id -1
[key value & {:keys [id]}]
{:db/id (or id -1)
:db/ident key
key value})

View File

@@ -536,7 +536,7 @@
_ (state/add-repo! {:url full-graph-name})
_ (route-handler/redirect-to-home!)
_ (db/transact! full-graph-name [(react/kv :db/type "db")
(react/kv :schema/version db-schema/version)])
(react/kv :schema/version db-schema/version {:id -2})])
initial-data (sqlite-create-graph/build-db-initial-data config/config-default-content)
_ (db/transact! full-graph-name initial-data)
_ (repo-config-handler/set-repo-config-state! full-graph-name config/config-default-content)