Ash FrameworkAF
Ash Framework3y ago
2 replies
gordoneliel

How To: Exclusion constraints in AshPostgres

Im setting up an exclusion constraint an a few time attributes. I dont see anywhere in the docs an affordance for exclusion constraints, only check constraints, so what I did is create the migration for the exclusion manually, but now im getting an ecto error asking me to add it to the changeset.
If you would like to stop this constraint violation from raising an
     exception and instead add it as an error to your changeset, please
     call `exclusion_constraint/3` on your changeset with the constraint
     `:name` as an option.


Question is, is this supported? Is there a way to add the exclusion without having to do it manually for each changeset in each action?
Was this page helpful?