Closed railsmechanic closed 1 year ago
@railsmechanic I'll take a look at this soon.
Cool, thank you! 👍🏻
@railsmechanic I was able to recreate the issue https://github.com/elixir-sqlite/ecto_sqlite3/compare/index-constraint-name-problem
The funky name is emitted from here
Who'da thought the function name constraint_name_hack/1
would be the culprit 🤣
@railsmechanic I have not forgotten this. Just haven't had time.
@railsmechanic I have not forgotten this. Just haven't had time.
No problem, I also have no time... 👍
Hi, I already posted this issue in the ecto repository, but @josevalim pointed me to this repository with the guess, that there might be additional quotes added around the index name in the migration.
Issue description
When creating an unique index with a custom expression as shown as in Ecto.Migration docs
and adding the
unique_constraint
check to the changeset with the name of the unique indexit raises the following
Ecto.ConstraintError
Please notice the strange name of the index
'branches_lower_name_index'_index
The expected behavior is that an error for the specified field is added to the changeset, instead of raising an
Ecto.ConstraintError
.Version information
Many thanks 👍