Author: russellm
Date: 2008-11-29 05:51:41 -0600 (Sat, 29 Nov 2008)
New Revision: 9535
Modified:
django/trunk/django/core/management/sql.py
Log:
Fixed #9717 -- Corrected a problem where django-admin.py flush would attempt to
flush database tables that had not yet been created. This occurred when an
application had been added to INSTALLED_APPS, but had not yet been
synchronized. Thanks to Julien Phalip for the patch.
Modified: django/trunk/django/core/management/sql.py
===================================================================
--- django/trunk/django/core/management/sql.py 2008-11-26 21:22:07 UTC (rev
9534)
+++ django/trunk/django/core/management/sql.py 2008-11-29 11:51:41 UTC (rev
9535)
@@ -119,13 +119,13 @@
def sql_flush(style, only_django=False):
"""
Returns a list of the SQL statements used to flush the database.
-
+
If only_django is True, then only table names that have associated Django
models and are in INSTALLED_APPS will be included.
"""
from django.db import connection
if only_django:
- tables = connection.introspection.django_table_names()
+ tables =
connection.introspection.django_table_names(only_existing=True)
else:
tables = connection.introspection.table_names()
statements = connection.ops.sql_flush(style, tables,
connection.introspection.sequence_list())
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---