Hi Rob,

On Tue, 2006-08-29 at 17:22 -0700, Rob Hudson wrote:
> I've got an app called page I've been working on.  Pages can contain
> text, graphics, or media and each have their own table which refer back
> to page (ForeignKey).  When I set up this model, only page_media has
> the inlined SQL for the foreign key ("REFERENCES"), where as the others
> do it with an ALTER TABLE syntax.  This seems odd to me that almost the
> identicle table definition is output differently.  Should I be
> concerned?  Should each table have similar SQL?

I see nobody answered this, so just in case you are still worried:

Don't be concerned. Whether we generate a "REFERENCES..." clause or an
"ALTER TABLE ..." statement is an artifact of the order in which the
various tables are constructed internally (somewhat related to Python's
dictionary hashing algorithm). The end result is the same, so the
difference is simply cosmetic. Note that all the "ALTER TABLE..."
statements are for what would have been illegal forward-references if we
had done them as inline "REFERENCES..." clauses.

We could maybe work around this in some cases by doing a topological
sort on the table creation structures, but it would be a non-trivial
internal rewrite of django.core.management and not necessarily worth the
effort (the code would become a little harder to maintain).

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to