我在我的模型中创建了一个隐藏的输入。py:
hidden = models.BooleanField(default=False)
,然后继续makemigrations
和migrate
我的更改。这样做之后,我决定将其删除,因此我去掉并删除了同一行并进行了makemigrations
,尽管这次我遇到了一条错误,结尾是:
File "/opt/django/www/local/lib/python2.7/site-packages/Django-1.8-py2.7.egg/django/db/backends/utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "/opt/django/www/local/lib/python2.7/site-packages/Django-1.8-py2.7.egg/django/db/backends/mysql/base.py", line 124, in execute
return self.cursor.execute(query, args)
File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 205, in execute
File "build/bdist.linux-x86_64/egg/MySQLdb/connections.py", line 36, in defaulterrorhandler
django.db.utils.OperationalError: (1091, "Can't DROP 'hidden'; check that column/key exists")
我处理不正确吗?
编辑:我可能坏了一些东西。
之后,我进入了我的应用程序/迁移并删除了迁移文件 ./manage.py migrate my_app 0010_previous_migration