5.3.5 The Model Tab

This section provides configuration options that affect the Modeling functionality in MySQL Workbench.

Figure 5.7 The Model Preferences

The Model preferences

Use the When Deleting Physical Model Figures in Diagram section to determine the behavior when deleting objects from the EER diagram canvas. Choose Ask and whenever you delete an object, you will be asked whether you wish to remove the object from an EER diagram only or also from the catalog. The Keep Database Object in Catalog is the safest option. You also have the option of deleting the object from both the EER diagram and the catalog.

Note

If you choose the Ask option, a confirmation dialog box opens only when you are deleting an object from an EER Diagram. When deleting in the MySQL Model view, there is no confirmation dialog window and the delete action always removes the object from the catalog.

There are a variety of ways to delete an object from an EER canvas: using the eraser tool; choosing a pop-up menu item; using the delete key; and by choosing the delete option from the Edit menu. In each case, the action performed by the delete key is determined by the option chosen from the When Deleting Physical Model Figures in Diagram section.

Use the Model tab to set the default value for various object names and the primary key data type. The following table shows the object names and their default values.

Object NameDefault Value
PK Column Nameid%table%
PK Column TypeINT
Column Name%table%col
Column TypeVARCHAR(45)
FK Namefk%stable_%dtable%
Foreign Key Column Name%table%_%column%
ON UPDATENO ACTION
ON DELETENO ACTION
Associative Table Name%stable%_has_%dtable%

The PK Column Name, PK Column Type, Column Name, and Column Type values are the defaults used by the table editor, and only function on Microsoft Windows and Mac OS X. The others are the default names used when using the relationship tools on an EER diagram.

Within object values items enclosed by percentage signs are variables. Their meanings are as follows:

Legitimate values for the foreign key update or delete rules are:

For more information about these actions, see Section 7.3.1.3.4, “The Foreign Keys Tab”.