Database Reference
In-Depth Information
The definition of this relation is now done. Although we did not relate any of the
fields in the author table to another table, it can be done. For example, we could
have a country code in this table and could create a relation to the country code of
a country table.
We will discuss the benefits of having defined this relation in a later section. For
now, we will see what happens if our tables are under the control of the InnoDB
or PBXT storage engine.
Foreign key relations
The InnoDB and PBXT storage engines offer us a foreign key system.
At your choice, the exercises in this section can be accomplished with
either InnoDB or PBXT. InnoDB has been chosen in the text.
First, we will switch our book and author tables to the InnoDB storage engine. We
can do this from the Operations subpage in the Table view. We start by doing this
for the author table, as shown in the following screenshot:
A problem arises when the storage engine of the book table is changed to InnoDB.
We have a full-text index in this table, and the InnoDB engine currently does not
support this kind of index:
ALTER TABLE `book` ENGINE = InnoDB;
MySQL said:
#1214 - The used table type doesn't support FULLTEXT indexes
 
Search WWH ::




Custom Search