Open BeArchiTek opened 2 weeks ago
I actually think we should split this up in 2 different issues
We define the following location hierarchy (Site > Building). We have a device node that has a relation to a building. However we need a device name to be unique within a site. Hence we want to define a unique constraint on the name of the device node and the second level of the location hierarchy.
Given the following location hierarchy (Country > Site). A site name should be unique within a country, so we want to define a uniqueness constraint on a site name and country. This is currently not possible because a parent is not a required relationship.
Component
API Server / GraphQL
Describe the Feature Request
As an user I would like to use any Parent of an hierarchical node as uniqueness_constraint (right now it’s not possible cause Parent, is not a mandatory field)
Describe the Use Case
I want to define the uniqueness of a node base on its Parent
Use case 1 A Rack name is unique on a Site
Use case 2 A Site short name is unique in a country
Additional Information
It could be indirectly cover by compute field if we consider some of those restriction as read_only field, computed from 2 others attributes and/or relationship