[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnumed-devel] Uniqueness in dem.lnk_identity2ext_id
From: |
Jim Busser |
Subject: |
[Gnumed-devel] Uniqueness in dem.lnk_identity2ext_id |
Date: |
Thu, 18 Nov 2010 14:13:18 -0800 |
Schema gnumed_v14
table dem.lnk_identity2ext_id
includes:
***************************************************************************
dem.identity.pk id_identity UNIQUE#1 NOT NULL
external_id UNIQUE#1 NOT
NULL
dem.enum_ext_id_types.pk fk_origin UNIQUE#1 NOT NULL
***************************************************************************
so I just wondered... yes, any one person can have multiple external IDs
therefore I understand that dem.identity.pk cannot be required to be unique by
itself. I only just wondered about dem.identity.pk being part of the constraint
of
{external_id, fk_origin}
being unique, since it allows different persons to have the same
{external_id, fk_origin}
but I then realized that in some cases a single external organization
(fk_origin) might re-use the same external_id for multiple persons (maybe an
account number used in common by a family). In other cases, the issuer would
NOT intend re-use across two different persons.
Would it work in dem.enum_ext_id_types to add the column
isunique
allowing to constrain the second scenario? That way, UNIQUE#1 NOT NULL could be
removed from from id_identity and it could be the
isunique = FALSE
that would determine if replicates of
{external_id, fk_origin}
could be allowed in a table?
-- Jim
- [Gnumed-devel] Uniqueness in dem.lnk_identity2ext_id,
Jim Busser <=