Foreign Key Name Mapping
The Foreign Key Name Mapping feature can help you to update the foreign key column name according to Foreign Key Pattern, it include Relationship name and referenced table information (foreign table and foreign primary key column name) in the Entity Relationship Diagram.
Configure the Foreign Key Pattern
You can define the Foreign Key Pattern. When you create the relationship between tables, the Foreign Key column creates and follows the Foreign Key pattern to name.
Select
Tools >
Options… to open the
Options Dialog.
Select the
Diagramming option on the right hand side area and then select
ERD & ORM tab
Modify the format of the Foreign Key Pattern with the predefine variables and It provide the Example to preview the result of the Foreign Key Pattern Format.
Click
Add variables… button to open the Add Foreign Key Pattern Variable Dialog. You can select all or individual variable add to the Foreign Key Pattern’s Format field.
For example, you draw a following ER Diagram. The Student table contains a foreign key column call Collegeid.
| variable | value |
| {fk_name} | CSRelationship(Relationship name) |
| {foreign_table_name} | College |
| {foreign_pk_columns} | cid |
Update the Foreign Key Column Name
{foreign_table_name}{foreign_pk_columns} is the default of the Foreign Key Pattern Format, so the ER Diagram creates the Foreign Key column call Collegecid in Student table.
Add the Customize String/variables for the Foreign Key Pattern.
Add the customize String such as “FK” for prefix of the Foreign Key Pattern and {fk_name} variable (
FK{foreign_table_name}{foreign_pk_columns}{fk_name}) and Click
OK to close the Options Dialog. The Collegecid column will rename according to the Foreign Key Pattern immediately(When your Foreign Key column never modify before) .
Modify the
foreign table name (College),
foreign primary key column name (cid) or
foreign key name (CSRelationship) then the
foreign key column name (Collegecid) also follows the new Foreign Key Pattern to update.
Change the
foreign primary key column name from cid to id then the
foreign Key column name allow the Foreign Key Pattern update from Collegeid to CollegeidCSRelationship.
Edit the foreign key column name
You can change the foreign key column name by yourself but the modified column name will not obey the Foreign Key Pattern to update when information change.
Change the FKCollegeidCSRelationship to CollegeidCSRelationship_FK.
When you modify the table name (College), foreign primary key name (cid) or foreign key name (CSRelationship). The altered
foreign key column name will not update to follow Foreign Key Pattern.

Downloads
Resources