Django flush vs sqlclear & syncdb

Jibin picture Jibin · Sep 29, 2011 · Viewed 27.3k times · Source

Can anyone tell if there is a difference between

>manage.py flush  # or reset

and

>manage.py sqlclear appname | python manage.py dbshell
>manage.py syncdb 

Answer

lajarre picture lajarre · Oct 22, 2012

flush will truncate (delete data)

sqlclear will drop (delete table, thus data too)

=> if you have structural modifications in your db, you have to do sqlclear (but better use south)

Update:

South has been deprecated.

From Django 1.7 upwards, migrations are built into the core of Django. If you are running a previous version, you can use South.