Unique constraint are validated even if the field is optional.

This is a follow up from #1458