Databases Reference
In-Depth Information
We can also set some actions with the
ON DELETE
and
ON UPDATE
options. For
example,
ON DELETE CASCADE
would make MySQL automatically delete all the
rows in the related (foreign) table when the corresponding row is deleted from the
parent table. This would be useful, for example, when the parent table is
invoices
,
and the foreign table is
invoice-items
. These options are supported natively by
MySQL, so deleting outside of phpMyAdmin would cause the delete cascade.
If we have not done so already, we should define the display
column for the
author
table, as explained in the
Deining the
display column
section.
Foreign keys without phpMyAdmin configuration
storage
We see the
Relation view
link on the
Structure
page of an
InnoDB
or
PBXT
table,
even when the configuration storage is not installed. This would bring us to a screen
where we could define the foreign keys, in this case for the
book
table.
Note that, if we choose this, the display column for the linked table (in this case
author
) cannot be defined, as it belongs to phpMyAdmin's configuration storage.
Thus, we would lose the benefit of seeing the associated description of the foreign key.
Defining relations with the Designer
The Ajax-based
Designer
offers a visually-driven way of managing relations (both
internal and foreign key-based), and defining the display column for each table. It
can also act as:
• A menu to access the structure of existing tables and to access the table
creation page
• A PDF schema manager, if we want a PDF schema encompassing all
our tables
On the
Designer
workspace, we can work on the relations for all tables on the same
panel. On the other hand, the
Relation view
shows the relations for only a single
table at a time.
We access this feature from the
Database
view by clicking on the
Designer
menu tab.
Search WWH ::
Custom Search