0
經過南遷移後,我最終刪除了一列。現在在我的表之一的當前數據搞砸了,我想刪除它,但嘗試刪除只是導致錯誤:遷移後在django應用程序上強制刪除行
>>> d = Degree.objects.all()
>>> d.delete()
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "C:\Python26\lib\site-packages\django\db\models\query.py", line 440, in d
elete
for i, obj in izip(xrange(CHUNK_SIZE), del_itr):
File "C:\Python26\lib\site-packages\django\db\models\query.py", line 106, in _
result_iter
self._fill_cache()
File "C:\Python26\lib\site-packages\django\db\models\query.py", line 760, in _
fill_cache
self._result_cache.append(self._iter.next())
File "C:\Python26\lib\site-packages\django\db\models\query.py", line 269, in i
terator
for row in compiler.results_iter():
File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 67
2, in results_iter
for rows in self.execute_sql(MULTI):
File "C:\Python26\lib\site-packages\django\db\models\sql\compiler.py", line 72
7, in execute_sql
cursor.execute(sql, params)
File "C:\Python26\lib\site-packages\django\db\backends\util.py", line 15, in e
xecute
return self.cursor.execute(sql, params)
File "C:\Python26\lib\site-packages\django\db\backends\sqlite3\base.py", line
200, in execute
return Database.Cursor.execute(self, query, params)
DatabaseError: no such column: students_degree.abbrev
>>>
有一個簡單的辦法只有強制刪除?我是否刪除表,然後重新運行manage.py schemamigration以在南方重新創建表?