Problem: I have some questions about the check constraint, default constraint, alternate key constraint and foreign key constraint naming. We are able to use macros to control the naming of our primary keys and some other objects. We would like to be able to do that with the objects listed above.
Solution:
Applies to the more recent versions of erwin dm such as r9.64 and above.
Please go to the menu Actions | Model Naming Options, Name Mapping tab.
Here is an example macro that may be used for the Key Group to Index:
%Switch(%Substr(%KeyType,1,2)){ %Choose(PK){PK_%TableName} %Choose(IF) {%Substr(%KeyType,2,1)K%Substr(%KeyType,3,1)_%TableName} %Choose(AK){%Substr(%KeyType,2,1)K%Substr(%KeyType,3,1)_%TableName}%Choose(IE){%Substr(%KeyType,2,1)K%Substr(%KeyType,3,1)_%TableName}}
