kdeforche/wt — pull request #5 by SaiFi0102 (2012-03-31 19:06:26+00:00)
Title: I am proposing some API additions in the SqlConnection backend abstract class to allow MySQL backend to set foreign_key_checks before and after creation of table process to solve the unordered creation of tables causing error 150 in MySQL.

...L backend.

Creating tables using Wt::Dbo::Session::createTables() while using a MySQL backend with InnoDB gives an error when a table has a foreign key constraint to a table which has still not been created. However this problem does not occur in SQLite backend.

Ordering the table creation does not work either because the table which has a foreign key also has a foreign key to the other table. Both tables have a foreign key linking each table with ManyToOne.
Disabling foreign_key_checks in MySQL during the Session::createTables() hopefully solves this issue.

The beforeCreateTable() backend function must have a strong exception safety.