From b6a960cd1df4a191fc2900bcaa76c73f2696fc4d Mon Sep 17 00:00:00 2001 From: Víðir Valberg Guðmundsson Date: Thu, 29 May 2014 23:03:10 +0200 Subject: [1.7.x] Making SQL management commands migration aware. --- django/core/management/commands/sqlsequencereset.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'django/core/management/commands/sqlsequencereset.py') diff --git a/django/core/management/commands/sqlsequencereset.py b/django/core/management/commands/sqlsequencereset.py index 9d25125efb..4f7ce4492a 100644 --- a/django/core/management/commands/sqlsequencereset.py +++ b/django/core/management/commands/sqlsequencereset.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals from optparse import make_option from django.core.management.base import AppCommand +from django.core.management.sql import check_for_migrations from django.db import connections, DEFAULT_DB_ALIAS @@ -22,6 +23,7 @@ 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) -- cgit v1.3