diff --git a/src/datascript/db.cljc b/src/datascript/db.cljc index 2b806b7f..a7fe1ec4 100644 --- a/src/datascript/db.cljc +++ b/src/datascript/db.cljc @@ -934,7 +934,7 @@ :key :db/isComponent}))) (validate-schema-key a :db/unique (:db/unique kv) #{:db.unique/value :db.unique/identity}) - (validate-schema-key a :db/valueType (:db/valueType kv) #{:db.type/ref :db.type/tuple}) + (validate-schema-key a :db/valueType (:db/valueType kv) ds/type?) (validate-schema-key a :db/cardinality (:db/cardinality kv) #{:db.cardinality/one :db.cardinality/many}) ;; tuple should have tupleAttrs diff --git a/src/datascript/schema.cljc b/src/datascript/schema.cljc index f917222a..f8d9517c 100644 --- a/src/datascript/schema.cljc +++ b/src/datascript/schema.cljc @@ -19,3 +19,12 @@ (defn schema-entity? [entity] (some #(contains? entity %) schema-keys)) + +(def type? + #{:db.type/number + :db.type/instant + :db.type/keyword + :db.type/ref + :db.type/string + :db.type/uuid + :db.type/tuple})