summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2008-11-29 11:55:05 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2008-11-29 11:55:05 +0000
commit19cb720df755b8ab9717b4e5693a08967ef68655 (patch)
tree3eddf31d6b59b12eb9b9a8407a78097600a26956 /django
parentb3f278258abca57c865dc1b6296a073f83a73a54 (diff)
[1.0.X] 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.
Merge of [9535] from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@9536 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django')
-rw-r--r--django/core/management/sql.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/management/sql.py b/django/core/management/sql.py
index 4874a49dde..14fd3f8214 100644
--- a/django/core/management/sql.py
+++ b/django/core/management/sql.py
@@ -119,13 +119,13 @@ def sql_reset(app, style):
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())