ITADN

Unique range attributes

#1726Closedmuazzam0x48 创建于 2025-04-02
enhancement
M
muazzam0x48commented
## Requirement The current :unique constraint prevents exact duplicates, but it should be enhanced to prevent overlapping values, especially for date ranges. For example, in the case of a :Project entity, when a uniqueness constraint is applied to its validity period (:ValidityStartDate to :ValidityEndDate), only one instance should be allowed within any given date range. ### Entity Definition ``` (entity :Project {:ValidityStartDate {:type :Date} :ValidityEndDate {:type :Date}}) ``` ## Rule No two :Project instances should have overlapping validity periods. That is, if a project already exists with a validity range [start1, end1], then no other project can be created or updated to have a validity range [start2, end2] such that the two ranges intersect.
关闭于 2025-04-03 0 条评论