Databases Reference
In-Depth Information
In the possible choices for the related key, we see the keys defined in all the
InnoDB
tables of the same database. (Creating a cross-database relation is currently not
supported in phpMyAdmin.) The keys defined in the current table are also shown,
as self-referring relations are possible. Let us remove the internal relation for the
author_id
column and click on
Save
. Our goal is to add an
InnoDB
-type relation for
the
author_id
column, but it's not possible as the
No index defined!
message appears
on this line. This is because foreign key definitions in
InnoDB
or
PBXT
can be done
only if both the columns have indexes.
Other conditions regarding constraints are explained in the
MySQL manual. Please refer to
http://dev.mysql.com/doc/
refman/5.1/en/innodb-foreign-key-constraints.html
.
Thus, we come back to the
Structure
page for the
book
table and add an ordinary
(non-unique) index to the
author_id
column producing the following screen:
In the
Relation view
, we can try again to add the relation we wanted; it works
this time!
Search WWH ::
Custom Search