Django flush vs sqlclear & syncdb

前端 未结 2 2119
长发绾君心
长发绾君心 2021-02-04 03:05

Can anyone tell if there is a difference between

>manage.py flush  # or reset

and

>manage.py sqlclear appname | python m         


        
2条回答
  •  后悔当初
    2021-02-04 03:14

    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.

提交回复
热议问题