Ah, that makes perfect sense now. It's the same principle when doing a .sql import, you disable foreign_key_checks, import, then enable.
Thanks for explaining this! Cal On Tue, Jun 28, 2011 at 2:41 PM, Jim Dalton <jim.dal...@gmail.com> wrote: > On Jun 28, 2011, at 6:29 AM, Cal Leeming [Simplicity Media Ltd] wrote: > > > Sorry for the noobish question but, could someone explain the definition > of "forward references"?? Is this a MySQL or a django term?? Google wasn't > very forthcoming :X > > Jacob actually requested that I add a note in the database docs on the > topic this patch addresses. So as a way of answering your question I'll > paste that note verbatim here: > > In previous versions of Django, fixtures with forward references (i.e. > relations to rows that have not yet been inserted into the database) would > fail > to load when using the InnoDB storage engine. This was due to the fact that > InnoDB > deviates from the SQL standard by checking foreign key constraints > immediately > instead of deferring the check until the transaction is committed. This > problem has been resolved in Django 1.4. Fixture data is now loaded with > foreign key > checks turned off; foreign key checks are then re-enabled when the data has > finished loading, at which point the entire table is checked for invalid > foreign > key references and an `IntegrityError` is raised if any are found. > > Is that note illuminating to you? If not, then presumably it needs work :) > > -- > You received this message because you are subscribed to the Google Groups > "Django developers" group. > To post to this group, send email to django-developers@googlegroups.com. > To unsubscribe from this group, send email to > django-developers+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-developers?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.