Key migration for logical data modeling

When you modify the properties of a primary key or a relationship in a logical data model, the properties of any related foreign keys are also modified.
The following table describes actions on an object that cause key migration actions to occur. When key migration actions occur, the icons that represent data objects in visual diagrams or in the Data Project Explorer change appropriately.
User action Key migration results
Add an attribute to a primary key

If the primary key takes part in a relationship, then the attribute is migrated to the child entity as a foreign key attribute.

If the relationship is identifying, then the migrated attribute is also included as part of the primary key attributes for the child entity.

If the attribute is already part of a foreign key, the rest of the foreign key attributes are already part of primary key, and the relationship is non-identifying, then the relationship is changed to identifying.

Remove an attribute from a primary key

If the primary key takes part in a relationship, then the attribute that had been migrated to the child entity as a foreign key is removed from the foreign key attributes list.

If the relationship is identifying, then the migrated attribute is also removed from the primary key attributes list for the child entity.

If the attribute is already part of a foreign key and the relationship is identifying, then the relationship is changed to non-identifying.

Reorder the attributes of a primary key If the primary key takes part in a relationship, then the migrated attributes in the foreign key are reordered to match the primary key.
Delete a primary key If the primary key participates in relationships, then the associated relationships and empty foreign keys are kept.
Modify the data type of an attribute If the attribute is part of a primary key and the primary key takes part in a relationship, then the data type of the migrated attribute on the child entity is also changed.
Modify the length, precision, or scale of a data type for an attribute If the attribute is part of a primary key and the primary key takes part in a relationship, then the data type length, precision, or scale of the migrated attribute on the child entity is also changed.
Delete an attribute

If the attribute is part of primary key or alternate key and the primary key or alternate key participates in a relationship, then the migrated attribute on the child entity is removed from the child foreign key attribute list.

If the relationship is identifying, then the migrated attribute on the child entity is also removed from the child primary key attribute list.

Add an attribute to an alternate key

If the alternate key takes part in a relationship, then the attribute is migrated to the child entity as a foreign key attribute.

If the relationship is identifying, then the migrated attribute is also included as part of the child entity's alternate key attributes.

If the attribute is already part of a foreign key, the rest of the foreign key attributes are already part of alternate key, and the relationship is non-identifying, then the relationship is changed to identifying.

Reorder the attributes of an alternate key No key migration occurs.
Remove an attribute from an alternate key

If the primary key takes part in a relationship, then the migrated attribute on the child entity is removed from the child foreign key attribute list.

If the relationship is identifying, then the migrated attribute on the child entity is removed from the primary key attribute list for the child entity.

Delete an alternate key If the alternate key participates in relationships, then the associated relationships and empty foreign keys are kept.
Add an attribute to a foreign key No key migration occurs.
Reorder the attributes of a foreign key No key migration occurs.
Remove an attribute from a foreign key If the attribute is part of a primary key or alternate key and the primary key or alternate key participates in a relationship, then the migrated attribute on the child entity is removed from the child foreign key attribute list. Otherwise, no key migration occurs.
Delete a foreign key The associated relationship is deleted from the child entity.
Add a relationship

If the relationship is an identifying relationship, the migrated attributes become part of the foreign key and the primary key of the child entity.

If the relationship is a non-identifying relationship, the migrated attributes become part of the foreign key of the child entity.

If the relationship is a many-to-many relationship, no key migration occurs.

Delete an identifying relationship The associated foreign key is deleted from the child entity.
Delete a non-identifying relationship The associated foreign key is deleted from the child entity.
Delete the parent entity of a relationship All migrated key attributes are removed from the foreign key of the child entity.
Modify the type of a relationship

If the relationship is changed from identifying to non-identifying, then foreign key attributes are removed from the primary key of the child entity.

If the relationship is changed from non-identifying to identifying, then foreign key attributes are added to the primary key of the child entity.

Create a generalization between two entities
  1. The primary key attributes of the super type entity are migrated to the sub type entity.
  2. If the subtype entity participates as a super type in existing generalizations, the key attributes are migrated along the generalizations, following the previous steps.
  3. If the subtype entity is a parent in existing relationships, the key attributes are migrated along the relationships.
Delete a generalization
  1. The migrated key attributes are removed from the subtype entity.
  2. If the subtype entity participates as a super type in existing generalizations, the key attribute deletion is migrated along the generalizations, following the previous steps.
  3. If the subtype entity participates as a parent in existing relationships, the key attribute deletion is migrated along the relationships.
Delete a supertype entity
  1. All generalizations referencing the supertype entity are deleted.
  2. The migrated key attributes are removed from the subtype entity.
  3. If the subtype entity participates as a super type in existing generalizations, the key attribute deletion is migrated along the generalizations, following the previous steps.
  4. If the subtype entity participates as a parent in existing relationships, the key attribute deletion is migrated along the relationships.
Delete a supertype primary key
  1. The migrated key attributes are removed from the subtype entity.
  2. If the subtype entity participates as a super type in existing generalizations, the key attribute deletion is migrated along the generalizations, following the previous steps.
  3. If the subtype entity participates as a parent in existing relationships, the key attribute deletion is migrated along the relationships.
Delete a primary key attribute of a supertype entity
  1. The migrated key attribute is removed from the subtype entity.
  2. If the subtype entity participates as a super type in existing generalizations, the key attribute deletion is migrated along the generalizations, following the previous steps.
  3. If the subtype entity participates as a parent in existing relationships, the key attribute deletion is migrated along the relationships.
Add a new primary key attribute to a supertype entity
  1. The new key attribute of the supertype entity is migrated to the subtype entity.
  2. If the subtype entity participates as a supertype in existing generalizations, the new key attribute is migrated along the generalizations, following the previous steps.
  3. If the subtype entity participates as a parent in existing relationships, the new key attribute is migrated along the relationships.
Modify a primary key attribute of a supertype entity
  1. The modification that you made to the key attribute of the supertype entity is migrated to the equivalent attribute in the subtype entity.
  2. If the subtype entity participates as a supertype in existing generalizations, the modification that you made to the key attribute is migrated along the generalizations, following the previous steps.
  3. If the subtype entity participates as a parent in existing relationships, the modification that you made to the key attribute is migrated along the relationships.
Reorder a primary key attribute of a supertype entity
  1. The position change that you made to the key attribute of the primary key list of the supertype entity is applied to the migrated key attribute in the attribute list of the foreign key that is associated with the generalization.
  2. If the subtype entity participates as a supertype in existing generalizations, the position change that you made to the key attribute is migrated along the generalizations, following the previous step.
  3. If the subtype entity participates as a parent in existing relationships, the position change that you made to the key attribute is migrated along the relationships.

Feedback