User
User

Reputation: 24731

Easiest way to drop all tables to run syncdb in Django?

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?

Upvotes: 0

Views: 818

Answers (1)

Yonsy Solis
Yonsy Solis

Reputation: 964

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.

Upvotes: 3

Related Questions