Django.db.utils.OperationalError: нет такого столбца: ...?
Я получил ошибку fowling, когда я выполнил ./manage.py migrate
в django sqlite DB
django.db.utils.OperationalError: no such column: users_user.phone_number
Когда я удалил всю историю миграций и makemigrations, проблема разрешилась. Но, конечно, я возвращаюсь к предыдущему коммиту, потому что не хочу удалять историю миграций. Есть идеи, как решить эту проблему без удаления истории миграций?
полное сообщение об ошибке
File "/Users/apple/.local/share/virtualenvs/backend-_hch_eH3/lib/python3.7/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/Users/apple/.local/share/virtualenvs/backend-_hch_eH3/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 383, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.OperationalError: no such column: users_user.phone_number
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/django_manage.py", line 52, in <module>
run_command()
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/django_manage.py", line 46, in run_command
run_module(manage_file, None, '__main__', True)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/apple/Documents/GitHub/solitary-poetry-26574/backend/manage.py", line 21, in <module>
main()
File "/Users/apple/Documents/GitHub/solitary-poetry-26574/backend/manage.py", line 17, in main
execute_from_command_line(sys.argv)
File "/Users/apple/.local/share/virtualenvs/backend-_hch_eH3/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()