Tables can also be added to an EER Diagram using the
table
tool on the vertical toolbar. To do this
make sure that the EER Diagram
tab is selected,
and right click the table icon on the vertical toolbar. The table
icon is the rectangular tabular icon.
Clicking the mouse on this icon changes the mouse pointer to a table pointer. You can also change the mouse pointer to a table pointer by pressing the T key.
Choosing the table
tool changes the contents of
the toolbar that appears immediately below the menu bar. When the
Tables
pointer is active, this toolbar contains
a drop down list box of schemata, a drop down list box of engines,
a drop down list box of collations, and a drop down color chart.
Use these list boxes to select the appropriate schema, engine,
collation, and color accent for the new table. Make sure that you
associate the new table with a database. The engine and collation
of a table can easily be changed from the table editor and the
color of your table can be changed later using the
Properties
palette. The Default
Engine
and Default Collation
values
refer to the database defaults.
Create a table by clicking anywhere on the EER Diagram canvas.
Doing this creates a new table with the default name
table1
. To revert to the default mouse pointer,
click the arrow icon at the top of the vertical toolbar.
As shown in the preceding diagram the primary key is indicated by a key icon and indexed fields are indicated by a different colored diamond icon. Click the arrow to the right of the table name to toggle the display of the fields. Toggle the display of indexes and triggers in the same way.
Right clicking a table opens a pop-up menu with the following options:
Cut
'table_name
'
Copy
'table_name
'
Edit Table
Edit in New Window
Copy SQL to Clipboard
Copy Insert to Clipboard
Delete
'table_name
'
With the exception of the deletion option, these menu options function as described in Section 7.5.1.1, “Adding Tables to the Physical Schemata”. The behavior of the delete option is determined by your MySQL Workbench options settings. For more information, see Section 5.4.4, “The Model Tab”.