Here are some steps involved. Using the current MySQL defacto
engine InnoDB. Of course, Falcon, PBXT and others will enable
alternative engines to be used.
Convert Table Storage Engine Types
$ mysql -u[user] -p[password] [database] -e "SHOW TABLES" | grep -v "Tables_in" | sed -e "s/^/ALTER TABLE /" | sed -e "s/$/ ENGINE=InnoDB;/" > upgrade.sql
$ mysql -u[user] -p[password] [database] < upgrade.sql
NOTE: This may not work for all tables, for example those with
FULLTEXT indexes will fail.
For the introduction of Referential Integrity we need to ensure
the following.
- Each Foreign Key column should have an index. Prior to 4.1 I
think this was a requirement, however it’s a good general
practice regardless for SQL performance.
- The datatype must match between Primary Key and Foreign Keys.
The most obvious oversight is normally UNSIGNED, however
you also for example have INT …
[Read more]