mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Fixed #14268 -- Start the deprecation of the reset and sqlreset management command. Thanks, Carl.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14888 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -20,6 +20,12 @@ class Command(AppCommand):
|
||||
output_transaction = True
|
||||
|
||||
def handle_app(self, app, **options):
|
||||
# This command breaks a lot and should be deprecated
|
||||
import warnings
|
||||
warnings.warn(
|
||||
'This command has been deprecated. The command ``flush`` can be used to delete everything. You can also use ALTER TABLE or DROP TABLE statements manually.',
|
||||
PendingDeprecationWarning
|
||||
)
|
||||
using = options.get('database', DEFAULT_DB_ALIAS)
|
||||
connection = connections[using]
|
||||
|
||||
|
||||
@@ -98,6 +98,12 @@ def sql_delete(app, style, connection):
|
||||
|
||||
def sql_reset(app, style, connection):
|
||||
"Returns a list of the DROP TABLE SQL, then the CREATE TABLE SQL, for the given module."
|
||||
# This command breaks a lot and should be deprecated
|
||||
import warnings
|
||||
warnings.warn(
|
||||
'This command has been deprecated. The command ``sqlflush`` can be used to delete everything. You can also use ALTER TABLE or DROP TABLE statements manually.',
|
||||
PendingDeprecationWarning
|
||||
)
|
||||
return sql_delete(app, style, connection) + sql_all(app, style, connection)
|
||||
|
||||
def sql_flush(style, connection, only_django=False):
|
||||
|
||||
Reference in New Issue
Block a user