Architecting and designing > Data modeling > Components of an entity relation diagram > Objects in an ERD > Attributes > Foreign key unification
  
Foreign key unification
Foreign keys can be propagated for any full model or subject area ERD.
Note The foreign keys are based on all entities and relations in the model, regardless of whether they are included on the current subject model diagram.
Use the Update FK command from the Dictionary menu to propagate foreign keys for the current diagram.
Note The datatype and/or qualifier of the attribute play no part in determining whether foreign keys will be unified.
The rules of unification are:
1 The role name overrides the attribute name.
2 If the net attribute names are the same, the foreign keys are unified. That is, the primary key in both the child and parent is the same data element, and either the attribute names are the same, or the role name effectively renders the attribute names the same.
3 If the net attribute names are the same, but the attribute names are different, the foreign keys are not unified.
4 If the data element names are different, even if the net attribute names are the same, the foreign keys are not unified. SA will create a new and unique attribute name for the foreign key by suffixing the attribute name of the parent entity with - n.
Parent entity PK
Child entity PK
Propagated PK/FK in child entity
Data element name: ID Attribute name: ID
Data element name: ID Attribute name: ID
Rule 1: Role name: Cust_ID ID [PK] Cust_ID.ID [PK][FK]
Data element name: ID Attribute name: ID
Data element name: ID Attribute name: ID
Rule 2: No role names: ID [PK][FK]
Data element name: ID Attribute name: ID
Data element name: ID Attribute name: Cust_ID
Rule 2: Role name: Cust_ID Cust_ID.ID [PK][FK]
Data element name: ID Attribute name: ID
Data element name: ID Attribute name: Cust_ID
Rule 3: No role name Cust_ID [PK] ID [PK] [FK]
Data element name: ID Attribute name: ID
Data element name: X_ID Attribute name: ID
Rule 4: No role names: ID [PK] ID-1.ID [PK][FK]
See also
Attributes