[英]Django - 'sqlclear' equivalent in Django > 1.9
In Django 1.10.6, I made a model, and ran python manage.py makemigrations
and python manage.py migrate
, it created a table in MySQL DB. 在Django 1.10.6中,我创建了一个模型,并运行了python manage.py makemigrations
和python manage.py migrate
,它在MySQL DB中创建了一个表。 Later I came to know that the table was not required. 后来我才知道桌子不是必需的。 I searched and found an answer here . 我在这里搜索并找到答案。 But that was for the versions before 1.9. 但那是1.9之前的版本。 In Django 1.9 sqlclear
has been removed. 在Django 1.9中, sqlclear
已被删除。 Now my doubt is, 现在我的怀疑是,
how can I drop a table from the DB using Django, for versions greater than 1.9? 对于大于1.9的版本,如何使用Django从数据库中删除表?
Is there any sqlclear
equivalent in versions greater than 1.9? 在大于1.9的版本中是否有任何sqlclear
等效?
Kindly help. 请帮助。
1. Delete your Model for the Table or comment it out totally
2. python manage.py makemigrations
3. python manage.migrate
hope it helps 希望能帮助到你
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.