16.4.4.4. The Model Tab

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

Use the When Deleting Physical Model Figures in Diagram frame 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 will only open 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 of deleting an object from an EER canvas; using the eraser tool, choosing a pop-up menu option, using the delete key, and by choosing the delete option under 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 frame.

Use the model tab to set the default value for various object names and the primary key data type. A listing of those items with their default values follows:

  • Primary Key Column Name: id%table%

  • Primary Key Column Type: INT

  • Column Name: %table%col

  • Column Type: VARCHAR(45)

  • Foreign Key Name: fk%stable_%dtable%

  • Foreign Key Column Name: %table%_%column%

  • ON UPDATE: NO ACTION

  • ON DELETE: NO ACTION

  • Associative Table Name: %stable%_has_%dtable%

The Primary Key Column Name is the default primary key column name when using the table editor. Likewise with the default primary key data type, and column name and column type. The remaining items are the default names used when using the relationship tools on an EER diagram.

Items enclosed by percentage signs are variables. Their meanings are as follows:

  • %table%: The table associated with the object

  • %column%: The column associated with the object

  • %stable%: The source table

  • %dtable%: The destination table

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

  • RESTRICT

  • CASCADE

  • SET NULL

  • NO ACTION (default)

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

Copyright © 2010-2024 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout