Databases Reference
In-Depth Information
This page tells us that:
We have an internal relation defined for author_id to the authors table.
We don't yet have any InnoDB relations defined.
We will be able to remove the internal relation, when the same relation has
been defined in InnoDB. This message can be seen when moving the mouse
over the small bulb light. In fact, phpMyAdmin advises us that the internal
relation is not necessary when it also exists in InnoDB, so it would be better
to remove it.
ON DELETE and ON UPDATE options are available for InnoDB relations.
The page might also tell us that our MySQL version is not up to date. (It needs to
be 4.0.13 or later.) If we have a version prior to 4.0.13, we won't be able to remove
a relation defined in InnoDB, due to a lack of support for the ALTER TABLE DROP
FOREIGN KEY statement. This is why phpMyAdmin could be giving us this friendly
(and crucial!) advice.
In the possible choices for the related key, we see the keys defined in all InnoDB
tables of the same database. (Creating a cross-database relation is currently not
supported in phpMyAdmin.) We even see the keys defined in the current table,
because self-referring relations are possible. We now remove the internal relation
for the author_id field and hit Save . We would like to add an InnoDB-type relation
for the author_id field, but we cannot - we see the No index defined! message on
this line. This is because foreign key definitions in InnoDB can be done only if both
 
Search WWH ::




Custom Search