vc-module-catalog icon indicating copy to clipboard operation
vc-module-catalog copied to clipboard

Create unique validator field

Open OlegoO opened this issue 7 years ago • 0 comments

@Woland2k commented on Thu Jul 20 2017

In order to allow unique field type of validation, create a new fields in PropertyValue named "ShortTextUniqueValue" and "IntegerUniqueValue" (unique will only be available for short and integer value fields).

Then create the following type of constraints:

CREATE UNIQUE NONCLUSTERED INDEX idx_shorttextuniquevalue_notnull ON PropertyValue(ShortTextUniqueValue) WHERE ShortTextUniqueValue IS NOT NULL;


@OlegoO commented on Thu Aug 31 2017

  1. Display [Is Unique] checkbox [UI]
  2. Add new column ShortTextUniqueValue, IntegerUniqueValue into persistent model
  3. Add Database constrain into repository
  4. Update model mapping (Domain to Persistent, Persistent to Domain)
  5. Display validation error on save if error is occurred

OlegoO avatar Aug 31 '17 12:08 OlegoO