MySQL Workbench Manual  /  ...  /  The Foreign Keys Tab

8.1.11.4 The Foreign Keys Tab

The Foreign Keys tab is organized in much the same fashion as the Indexes tab and adding or editing a foreign key is similar to adding or editing an index. The following figure shows an example of the Foreign Keys tab.

Figure 8.20 The Foreign Keys Tab

The figure content is described in the surrounding text.

To add a foreign key, click the last row in the Foreign Key Name list. Enter a name for the foreign key and select the column or columns that you wish to index by checking the column name in the Column list. You can remove a column from the index by removing the check mark from the appropriate column.

Under Foreign Key Options, choose an action for the update and delete events. The options are:

  • RESTRICT

  • CASCADE

  • SET NULL

  • NO ACTION

To drop a foreign key, right-click the row you wish to delete, then select the Delete Selected FKs menu item.

To modify properties of a foreign key, select it and make the desired changes.


User Comments
Sign Up Login You must be logged in to post a comment.