datahike
datahike copied to clipboard
"Update not supported for these schema attributes" - which ones?
I have a growing vector of schema txes. Sometimes I'll add a new attribute. When I try to transact this, Datahike throws:
@(d/transact! conn many-schema-changes)
Execution error (ExceptionInfo) at datahike.db/transact-tx-data (db.cljc:1341).
Update not supported for these schema attributes
Very hard to debug if I don't know which attributes are a problem, so I can at least tx them separately. Ideally, would like an "ensure-attrs" that throws for an incompatible migration.
So, your are updating multiple schema-attributes in one transaction?
If you are running this in a repl, what does *e
print? The :invalid-updates
in the ExceptionInfo
data might give some information.
Noticed that when I attempt to add :db/index true
to an attribute it fails in the map form, but succeeds when using the vector form, e.g. [[:db/add 123 :db/index true]]
. It fails when trying to update this:
{:db/ident :catalog/store
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/one}
to this:
{:db/ident :catalog/store
:db/valueType :db.type/ref
:db/cardinality :db.cardinality/one
:db/index true}
But the update succeeds when transacting (d/transact d/conn [[:db/add [:db/ident :catalog/store] :db/index true]])
.
Should I open a separate issue?