Missing unique constraint for contact roles
It is possible to add multiple contact roles with the same
- role_name
- contact id
- device/platform/configuration/site id (site was not tested).
The expected behavior is that this is not allowed and the combination of the three fields is unique.
As a workaround, unique constraints can be created:
ALTER TABLE public.device_contact_role ADD CONSTRAINT device_contact_role_un UNIQUE (role_name,contact_id,device_id);
ALTER TABLE public.platform_contact_role ADD CONSTRAINT platform_contact_role_un UNIQUE (role_name,contact_id,platform_id);
ALTER TABLE public.configuration_contact_role ADD CONSTRAINT configuration_contact_role_un UNIQUE (role_name,contact_id,configuration_id);
Edited by Ulrich Loup