Added an optional unique field to Album and checked that duplicates are detected.
Forgot to add the ref field to the field list.
More complex test case.
Fixed the validation for optional fields that have a value.
Merge pull request #1459 from linovia/bugfix/optional_unique_validation

Unique constraint are validated even if the field is optional.