# \#constraints

**URL:** https://forum.elixirforum.com/tag/constraints/2201.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Constraint error on struct delete while using delete\_all option](https://forum.elixirforum.com/t/constraint-error-on-struct-delete-while-using-delete-all-option/29565)

<div class="topic-metadata">

**Author:** [@broke](https://forum.elixirforum.com/u/broke)\
**Replies:** 4\
**Last updated:** [May 9, 2022, 5:41am UTC](https://forum.elixirforum.com/t/constraint-error-on-struct-delete-while-using-delete-all-option/29565 "2022-05-09T05:41:51Z")

</div>

Hello, I’m getting the following error while running a unit test that deletes an “artist” entity that has “tag” associations (the desired behavior is for the associations to be deleted when the parent is deleted). \*\* (E…

---

## [Unique Index/Constraint allow duplicates ONLY when ALL references are null](https://forum.elixirforum.com/t/unique-index-constraint-allow-duplicates-only-when-all-references-are-null/35547)

<div class="topic-metadata">

**Author:** [@Owens](https://forum.elixirforum.com/u/Owens)\
**Replies:** 5\
**Last updated:** [December 23, 2020, 4:23pm UTC](https://forum.elixirforum.com/t/unique-index-constraint-allow-duplicates-only-when-all-references-are-null/35547 "2020-12-23T16:23:38Z")

</div>

Hello all, I’m creating a chat app that automatically creates chats between different groups of people as well as individuals. I want to make sure it doesn’t create any duplicates for the chats between these groups, but…

---

## [Creating a unique constraint on two columns together in Ecto](https://forum.elixirforum.com/t/creating-a-unique-constraint-on-two-columns-together-in-ecto/32405)

<div class="topic-metadata">

**Author:** [@nikolis](https://forum.elixirforum.com/u/nikolis)\
**Replies:** 4\
**Last updated:** [June 18, 2020, 4:48am UTC](https://forum.elixirforum.com/t/creating-a-unique-constraint-on-two-columns-together-in-ecto/32405 "2020-06-18T04:48:16Z")

</div>

Hello Fellas, I am trying to enforce uniquness in a table using to combined fields I originally followed this instructions Stackoverflow thread which seems to work for everybody apart from my self and I do not seem to g…

---

## [Constraints in Routes](https://forum.elixirforum.com/t/constraints-in-routes/29521)

<div class="topic-metadata">

**Author:** [@Sanjibukai](https://forum.elixirforum.com/u/Sanjibukai)\
**Replies:** 8\
**Last updated:** [March 2, 2020, 5:28pm UTC](https://forum.elixirforum.com/t/constraints-in-routes/29521 "2020-03-02T17:28:07Z")

</div>

Hi everybody, I wanted to know if we can have constraints in the route level. I mean defining a route with some constraints (based e.g. on the request sessions data). Sorry if I do a parallel with rails, but in rails (…
