Unique constraints help to enforce the uniqueness of specific columns. You can add unique constraints to an entity to make sure that no duplicate values are entered in specific columns. A unique constraint may consist of a single column, or combination of columns.
Creating a unique constraint
To create a unique constraint:
- Right click on the entity and select Open Specification… from the popup menu.
- Open the Constraints tab.
- At the bottom right of the specification window, click Add > Unique Constraint….
- In the Unique Constraint Specification window, enter the name of the constraint.
- Select the columns to be included and click >.
- Click OK to return to the Entity Specification.
- Click OK to return to the diagram. You can see the selected column(s) is marked unique.
Showing the name of unique constraints in entity
To show the name of unique constraint in entities in an ERD, right click on the ERD and select Presentation Options > Entity Columns Display Options > Show Column Unique Constraint Name from the popup menu. With enough shape width, you can see the constraint names of columns.