修复数据异常

Fixing a datomic anomalie

我在玩我的数据数据库。我想我的数据库损坏了,我不确定从哪里开始调试或修复我的数据库状态

当我尝试运行我的应用

(def cfg {:server-type        :peer-server
          :access-key         "myaccesskey"
          :secret             "mysecret"
          :endpoint           "localhost:8998"
          :validate-hostnames false})

(def client (d/client cfg))

(def conn (d/connect client {:db-name "pensine"}))

(def o11-schema [
                 {:db/ident :trip/name}
                 {:db/valueType :db.type/string}
                 {:db/cardinality :db.cardinality/one}])

失败并出现此错误

Caused by: clojure.lang.ExceptionInfo: Missing :db/ident for {:db/id 75, :db/valueType 23} {:cognitect.anomalies/category :cognitect.anomalies/incorrect, :cognitect.anomalies/message "Missing :db/ident for {:db/id 75, :db/valueType 23}", :entity {:db/id 75, :db/valueType 23}, :db/error :db.error/attribute-ident-missing, :dbs [{:database-id "datomic:dev://localhost:4334/pensine", :t 1011, :next-t 1012, :history false}]}

我错误地将模式放在了三个不同的地图中,这是解决方法:

[{:db/ident :trip/name
  :db/valueType :db.type/string
  :db/cardinality :db.cardinality/one}]