summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2020-06-04 02:59:47 -0700
committerGitHub <noreply@github.com>2020-06-04 11:59:47 +0200
commitf997b5e6ae85e2df2342b1a7812fe8130206c957 (patch)
treea5efc274e1290fb838ef41e5646abfcf7ea9f33c
parentfcdac3787dc9863255291a45ebd039ea708ab6b9 (diff)
Refs #5086 -- Removed unused only_django argument from sql_flush().
Unused (always True) since its introduction in 132605d889db8767a40243259066b8450428714c.
-rw-r--r--django/core/management/commands/flush.py2
-rw-r--r--django/core/management/commands/sqlflush.py2
-rw-r--r--django/core/management/sql.py10
3 files changed, 4 insertions, 10 deletions
diff --git a/django/core/management/commands/flush.py b/django/core/management/commands/flush.py
index 6ccc9994dd..6737b9be40 100644
--- a/django/core/management/commands/flush.py
+++ b/django/core/management/commands/flush.py
@@ -44,7 +44,7 @@ class Command(BaseCommand):
except ImportError:
pass
- sql_list = sql_flush(self.style, connection, only_django=True,
+ sql_list = sql_flush(self.style, connection,
reset_sequences=reset_sequences,
allow_cascade=allow_cascade)
diff --git a/django/core/management/commands/sqlflush.py b/django/core/management/commands/sqlflush.py
index 22e77254ea..29782607bb 100644
--- a/django/core/management/commands/sqlflush.py
+++ b/django/core/management/commands/sqlflush.py
@@ -19,7 +19,7 @@ class Command(BaseCommand):
)
def handle(self, **options):
- sql_statements = sql_flush(self.style, connections[options['database']], only_django=True)
+ sql_statements = sql_flush(self.style, connections[options['database']])
if not sql_statements and options['verbosity'] >= 1:
self.stderr.write('No tables found.')
return '\n'.join(sql_statements)
diff --git a/django/core/management/sql.py b/django/core/management/sql.py
index 27113dbbbe..1e55a24802 100644
--- a/django/core/management/sql.py
+++ b/django/core/management/sql.py
@@ -2,17 +2,11 @@ from django.apps import apps
from django.db import models
-def sql_flush(style, connection, only_django=False, reset_sequences=True, allow_cascade=False):
+def sql_flush(style, connection, reset_sequences=True, allow_cascade=False):
"""
Return a list of the SQL statements used to flush the database.
-
- If only_django is True, only include the table names that have associated
- Django models and are in INSTALLED_APPS .
"""
- if only_django:
- tables = connection.introspection.django_table_names(only_existing=True, include_views=False)
- else:
- tables = connection.introspection.table_names(include_views=False)
+ tables = connection.introspection.django_table_names(only_existing=True, include_views=False)
return connection.ops.sql_flush(
style,
tables,