我修改了我的模型并进行了数据库迁移。然后我再次修改了我的模型,但在尝试运行python manage.py migrate时出现错误:
Operations to perform:
Apply all migrations: admin, auth, contenttypes, sessions, shop
Running migrations:
Applying shop.0004_auto_20180128_1331...Traceback (most recent call last):
File "/home/morilon/dj/intshop/venv/lib/python3.6/site-packages/django/db/backends/utils.py", line 83, in _execute
return self.cursor.execute(sql)
File "/home/morilon/dj/intshop/venv/lib/python3.6/site-packages/django/db/backends/sqlite3/base.py", line 301, in execute
return Database.Cursor.execute(self, query)
sqlite3.OperationalError: table "shop_brand" already exists
所以我的问题是 - 如何删除表 "shop_brand"??? 我已经尝试过
flush
和sqlflush
,但这只会从表中删除数据而不是实际的表 "shop_brand"。
我使用django 2.0.1和python 3.6。