I have searched the forum and have not seen any indication this request has been made before. Apologies if I missed it.
I need to be able to make some kind of constraint on a schema that essentially considers 2 or more fields as unique together, like a composite key.
I’m less concerned about whether I need to do this as a rule, a script or as a toggleable setting in the Squidex UI (like say, making a content section unique as a way to group fields).
F1 and F2 are part of my unique group.
| Row | F1 | F2 | Allowed | | ------- | ------- | ------- | ------- | | 1 | Val1 | Val2 | Y | | 2 | Val1 | Val3 | Y | | 3 | Val2 | Val2 | Y | | 4 | Val2 | Val3 | Y | | 5 | Val1 | Val3 | N |
The 5th insert above conflicts with the composite unique value of F1 and F2. F1 is allowed to have repeating values, as is F2 so long as the pair do not combine to break that.