Changes between Initial Version and Version 1 of Ticket #23790


Ignore:
Timestamp:
Nov 10, 2014, 5:48:14 AM (9 years ago)
Author:
Markus Holtermann
Comment:

It partially works. If there are no migrations for an app yet, all migrations will be created with the changed label in the dependencies and all places it's being referenced. But as soon as you already have existing migrations and then change the label of an app, the makemigrations command blows up with:

Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/markus/Coding/django/django/core/management/__init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "/home/markus/Coding/django/django/core/management/__init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/markus/Coding/django/django/core/management/base.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/markus/Coding/django/django/core/management/base.py", line 442, in execute
    output = self.handle(*args, **options)
  File "/home/markus/Coding/django/django/core/management/commands/makemigrations.py", line 58, in handle
    loader = MigrationLoader(None, ignore_no_migrations=True)
  File "/home/markus/Coding/django/django/db/migrations/loader.py", line 48, in __init__
    self.build_graph()
  File "/home/markus/Coding/django/django/db/migrations/loader.py", line 295, in build_graph
    _reraise_missing_dependency(migration, parent, e)
  File "/home/markus/Coding/django/django/db/migrations/loader.py", line 265, in _reraise_missing_dependency
    raise exc
  File "/home/markus/Coding/django/django/db/migrations/loader.py", line 291, in build_graph
    self.graph.add_dependency(migration, key, parent)
  File "/home/markus/Coding/django/django/db/migrations/graph.py", line 47, in add_dependency
    parent
django.db.migrations.graph.NodeNotFoundError: Migration testapp.0002_proxy dependencies reference nonexistent parent node ('otherapp', '0001_initial')

The only way I can think of is using the appconfig.name attribute instead of appconfig.label. But that's hard to find a smooth migration path.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23790

    • Property Cc info+coding@… added
  • Ticket #23790 – Description

    initial v1  
    44
    55(I haven't tried to create such a problem. I'm just making a note before I forget.)
     6
     7The only way I can think of is using the `appconfig.name` attribute instead of `appconfig.label`. But that's hard to find a smooth migration path.
Back to Top