digitallyinduced/ihp
Create Validation function for UNIQUE constraint over multiple fields
开放
#877 创建于 2021年5月18日
enhancementgood first issue
仓库指标
- 星标
- (5,285 个星标)
- PR 合并指标
- (平均合并 11小时 20分钟) (30 天内合并 21 个 PR)
描述
We are currently only able to validate that a single field is unique in its table. However, there are use-cases in which a pair or more of attributes should be unique inside the table. In SQL this can be expressed using a constraint such as:
ALTER TABLE recipes ADD CONSTRAINT recipes_unique_name_in_group UNIQUE (group_id, name);
It would be good if we had a function similar to validateIsUnique that validates this constraint.
Naming suggestions:
validateAreUniquevalidateIsUniqueCompositevalidateAreUniqueFieldsvalidateIsUniqueSet