Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.0.X] Fixed #9717 -- Corrected a problem where django-admin.py flus…

…h 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
  • Loading branch information...
commit 19cb720df755b8ab9717b4e5693a08967ef68655 1 parent b3f2782
@freakboy3742 freakboy3742 authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 django/core/management/sql.py
View
4 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())
Please sign in to comment.
Something went wrong with that request. Please try again.