summaryrefslogtreecommitdiffstats
path: root/webapp/django/core/management/commands/sqlsequencereset.py
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/django/core/management/commands/sqlsequencereset.py')
-rw-r--r--webapp/django/core/management/commands/sqlsequencereset.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/webapp/django/core/management/commands/sqlsequencereset.py b/webapp/django/core/management/commands/sqlsequencereset.py
new file mode 100644
index 0000000000..e8dad0bef6
--- /dev/null
+++ b/webapp/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 u'\n'.join(connection.ops.sequence_reset_sql(self.style, models.get_models(app))).encode('utf-8')