diff options
Diffstat (limited to 'django/core/management/commands/sqlsequencereset.py')
| -rw-r--r-- | django/core/management/commands/sqlsequencereset.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/django/core/management/commands/sqlsequencereset.py b/django/core/management/commands/sqlsequencereset.py new file mode 100644 index 0000000000..6b12d83843 --- /dev/null +++ b/django/core/management/commands/sqlsequencereset.py @@ -0,0 +1,9 @@ +from django.core.management.base import AppCommand + +class Command(AppCommand): + help = 'Prints the SQL statements for resetting sequences for the given app name(s).' + output_transaction = True + + def handle_app(self, app, **options): + from django.db import connection, models + return '\n'.join(connection.ops.sequence_reset_sql(self.style, models.get_models(app))) |
