you also to use validate_change ( Ecto.Changeset — Ecto v3.14.0 )
There is a reference in this post Validates not nil of fields only when they exist
you also to use validate_change ( Ecto.Changeset — Ecto v3.14.0 )
There is a reference in this post Validates not nil of fields only when they exist