On Thu, Jul 30, 2009 at 12:48 AM, Aaron<aaronelliotr...@gmail.com> wrote: > > Hi all, > > Is there a way to force the order of apps from which fixtures are > loaded? We have fixtures in one app that depend ( via foreign keys ) > on fixtures in another app being already loaded.
In short no. The problem you describe only exists if you are using MySQL with InnoDB tables, due to MySQL's creative interpretation of row-referential integrity. On databases with no referential integrity (SQLite, MySQL/MyISAM), forward references aren't checked at all; on databases with correctly implemented referential integrity (Postgres/Oracle), referential checks aren't made until the end of the transaction, and all fixtures are loaded in a single transaction. MySQL/InnoDB checks references after every insert, and can't defer to the transaction boundary - which means that forward references can't be created, even in a transaction. While your specific problem might be solved by ordering, this is a problem that _can't_ be solved by ordering in the general case - the simple example is circular references. As a result, we haven't put any effort into developing a workaround - we've just documented that if you want to use MySQL/InnoDB, you get to dance with the girl you brought :-) Yours, Russ Magee %-) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---