0

I keep making minor changes in my Django models. I don't care about the test data I keep adding, I just want to drop all tables (models) so I can run syncdb again. manage.py flush doesn't delete table schema, it just removes data.

Is there a quicker function in Django 1.6 to drop all tables?

User
  • 23,729
  • 38
  • 124
  • 207

1 Answers1

3

1) Django 1.6 is an unsupported Django version https://www.djangoproject.com/download/#supported-versions

you can see that Django 1.6 was supported until April 2015. So try to migrate to 1.8 LTS or 1.9 now and have migrations in your Django project or integrate South in your old Django app to have migrations http://south.readthedocs.org/en/latest/index.html

2) No there is not a quicker function in Django 1.6 (django-admin/manage.py command) that drop all tables. The more closer thing in this old versions is:

manage.py sqlclear appname

and put the output in your sql shell, maybe can work with pipe.

manage py sqlclear appname | manage.py dbshell

at least with MySQL works well.

Yonsy Solis
  • 944
  • 9
  • 14