What is the django command to delete all tables?

前端 未结 7 1999
清歌不尽
清歌不尽 2021-01-31 16:47

Are there django commands that

A. Delete all tables

B. delete all data in all tables

C. Create all tables as defined in the model?

7条回答
  •  执念已碎
    2021-01-31 17:05

    Neither manage.py sqlclear nor manage.py reset is capable of dropping all tables at once, both require an appname parameter.

    You should take a look at Django Extensions, it gives you access to manage.py reset_db as well as many other useful management commands.

提交回复
热议问题