Welcome! Please see the About page for a little more info on how this works.

0 votes
ago in On-Prem by

I have a tuple constraint as follows:

#:db{:id 182,
 :ident :ps2st/product-set+style-tier,
 :valueType :db.type/tuple,
 :cardinality :db.cardinality/one,
 :unique :db.unique/identity,
 :tupleAttrs [:ps2st/product-set :ps2st/style-tier]}

This constraint is overly restrictive. I read somewhere that tupleAttrs can not be altered, so I'd like to remove the constraint instead and then create a new one with more tuple attrs.

How can I delete a constraint?

2 Answers

0 votes
ago by
selected ago by
Best answer

I should also mention that I tried the following:

@(d/transact c [[:db/retractEntity :ps2st/product-set+style-tier]])

But I'm not sure what this error means:

Execution error (Exceptions$IllegalArgumentExceptionInfo) at datomic.error/deserialize-exception (error.clj:146).
:db.error/datom-cannot-be-altered Boot datoms cannot be altered: [:db.part/db :db.install/attribute :ps2st/product-set+style-tier 13194139571760 false]

ago by
What if you `[:db/retract :ps2st/product-set+style-tier :db/unique :db.unique/identity]` ?
It should keep the tuple and just drop the uniqueness
ago by
Thanks, Enzzo.   That worked exactly as expected and resolved my problem.  

I'm marking this "answer" as "best" b/c your comment is here.  If you want to put your comment in a separate answer, I can mark that one instead?
0 votes
ago by

Hi. Just adfitional info, you got error on an aytemt to retract the attribute because the datomin does not allow to remove attributes from db.

ago by
Thanks for the info!
Welcome to the Datomic Knowledgebase, where you can make features requests, ask questions and receive answers from other members of the community.