Comment 3 for bug 931602

Revision history for this message
Adam Gandelman (gandelman-a) wrote :

Hey Dan,

Finally got a chance to look at this. Yeah, that doesn't address whats really going on. It seems the schema ends up being created much differently wrt foreign key constraints depending on how the MySQL server is configured prior to running any database. Migrating the database to v76 (just prior to this failing migration) against two MySQL configurations, one MyISAM and the other InnoDB, leads to two *very different* schemas in terms of foreign keys. I've captured the differences using some visualization software:

http://people.canonical.com/~agandelman/schema/innodb/relationships.html
http://people.canonical.com/~agandelman/schema/myisam/relationships.html

The following patch fixes the issue for me by addressing all other FK parents early on with the instances table: http://paste.ubuntu.com/841173/ This seems a bit clunky but works. I'd like to look into the issue a bit more and see how this might also affect other database backends.