Answer the question
In order to leave comments, you need to log in
Why can't I rebuild Django migrations?
There is a project in which there is a sqlite database with a certain content. I want to delete migrations and create new ones. I deleted the contents of the Migrations folder, the database file, but with makemigrations or any other command related to migrations, the following error pops up:
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm /django_manage.py", line 52, in
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 "/usr/local/lib/python3.5/runpy.py", line 205, in run_module
return _run_module_code(code, init_globals, run_name, mod_spec)
File "/usr/local/lib/python3.5/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/local/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/Users/thrashches/Documents/Development/pizza_project-master/manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/Users/thrashches/Documents/Development /pizza_project-master/pizza/lib/python3.5/site-packages/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/Users/thrashches/Documents/Development/pizza_project -master/pizza/lib/python3.5/site-packages/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/thrashches/Documents/Development/pizza_project-master/pizza/lib/python3.5/site-packages/django/core/management/base.py" , line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/thrashches/Documents/Development/pizza_project-master/pizza/lib/python3.5/site-packages/django/core/management/ base.py", line 330, in execute
output = self.handle(*args, **options)
File "/Users/thrashches/Documents/Development/pizza_project-master/pizza/lib/python3.5/site-packages/ django/core/management/commands/makemigrations.py", line 96, in handle
loader = MigrationLoader(None, ignore_no_migrations=True)
File "/Users/thrashches/Documents/Development/pizza_project-master/pizza/lib/python3.5/site-packages/django/db/migrations/loader.py", line 52, in __init__
self.build_graph()
File " /Users/thrashches/Documents/Development/pizza_project-master/pizza/lib/python3.5/site-packages/django/db/migrations/loader.py", line 274, in build_graph
raise exc
File "/Users/thrashches/ Documents/Development/pizza_project-master/pizza/lib/python3.5/site-packages/django/db/migrations/loader.py", line 244, in build_graph
self.graph.validate_consistency()
File "/Users/thrashches/ Documents/Development/pizza_project-master/pizza/lib/python3.5/site-packages/django/db/migrations/graph.py", line 261, in validate_consistency
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "/Users/thrashches/Documents/Development/pizza_project-master/pizza/lib/python3.5/site-packages /django/db/migrations/graph.py", line 261, in
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "/Users/thrashches/Documents/Development /pizza_project-master/pizza/lib/python3.5/site-packages/django/db/migrations/graph.py", line 104, in raise_error
raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration pizza_auth_app.0001_initial dependencies reference nonexistent parent node ('pizza_app', '0002_loaddata')
Files 0001 and 0002 are no longer there. Tried migrate pizza_app zero. The error with any manipulations from the tips in Google is the same. Where to dig?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question