datahike icon indicating copy to clipboard operation
datahike copied to clipboard

"Update not supported for these schema attributes" - which ones?

Open theronic opened this issue 4 years ago • 3 comments

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.

theronic avatar Jun 04 '20 11:06 theronic

So, your are updating multiple schema-attributes in one transaction?

kordano avatar Jun 05 '20 15:06 kordano

If you are running this in a repl, what does *e print? The :invalid-updates in the ExceptionInfo data might give some information.

kordano avatar Jun 05 '20 15:06 kordano

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?

theronic avatar Jun 22 '20 11:06 theronic