Fixed #24054 -- Enabled sqlsequencereset for apps with migrations.

This commit is contained in:
Tim Graham 2014-12-26 15:27:11 -05:00
parent 1729a5250b
commit c2e419c267
2 changed files with 3 additions and 2 deletions

View File

@ -1,7 +1,6 @@
from __future__ import unicode_literals
from django.core.management.base import AppCommand
from django.core.management.sql import check_for_migrations
from django.db import connections, DEFAULT_DB_ALIAS
@ -20,7 +19,6 @@ class Command(AppCommand):
if app_config.models_module is None:
return
connection = connections[options.get('database')]
check_for_migrations(app_config, connection)
models = app_config.get_models(include_auto_created=True)
statements = connection.ops.sequence_reset_sql(self.style, models)
return '\n'.join(statements)

View File

@ -167,3 +167,6 @@ Bugfixes
instead of ``DeleteModel`` and ``CreateModel`` operations when changing
``Meta.managed``. This prevents data loss when changing ``managed`` from
``False`` to ``True`` and vice versa (:ticket:`24037`).
* Enabled the ``sqlsequencereset`` command on apps with migrations
(:ticket:`24054`).