diff options
| author | Raffaele Salmaso <raffaele@salmaso.org> | 2014-08-22 09:26:06 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-08-23 19:18:03 -0400 |
| commit | abd640fbdfce2c8dc8bca039525694d3a1a0297a (patch) | |
| tree | be79057df3ad9de1b0faaeddf85998443e206193 /django | |
| parent | 19999befbec89171f7b3d6d75d3b0600e5c41cc0 (diff) | |
Fixed #23341 -- Added migration name to nonexistent migration error in makemigrations.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/graph.py | 6 | ||||
| -rw-r--r-- | django/db/migrations/loader.py | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/django/db/migrations/graph.py b/django/db/migrations/graph.py index 59578b110f..27b4105dcc 100644 --- a/django/db/migrations/graph.py +++ b/django/db/migrations/graph.py @@ -35,11 +35,11 @@ class MigrationGraph(object): def add_node(self, node, implementation): self.nodes[node] = implementation - def add_dependency(self, child, parent): + def add_dependency(self, migration, child, parent): if child not in self.nodes: - raise KeyError("Dependency references nonexistent child node %r" % (child,)) + raise KeyError("Migration %s dependencies references nonexistent child node %r" % (migration, child)) if parent not in self.nodes: - raise KeyError("Dependency references nonexistent parent node %r" % (parent,)) + raise KeyError("Migration %s dependencies references nonexistent parent node %r" % (migration, parent)) self.dependencies.setdefault(child, set()).add(parent) self.dependents.setdefault(parent, set()).add(child) diff --git a/django/db/migrations/loader.py b/django/db/migrations/loader.py index 2fb2098e48..9a3dd80d47 100644 --- a/django/db/migrations/loader.py +++ b/django/db/migrations/loader.py @@ -230,7 +230,7 @@ class MigrationLoader(object): if parent[0] != key[0] or parent[1] == '__first__': # Ignore __first__ references to the same app (#22325) continue - self.graph.add_dependency(key, parent) + self.graph.add_dependency(migration, key, parent) for key, migration in normal.items(): for parent in migration.dependencies: if parent[0] == key[0]: @@ -238,11 +238,11 @@ class MigrationLoader(object): continue parent = self.check_key(parent, key[0]) if parent is not None: - self.graph.add_dependency(key, parent) + self.graph.add_dependency(migration, key, parent) for child in migration.run_before: child = self.check_key(child, key[0]) if child is not None: - self.graph.add_dependency(child, key) + self.graph.add_dependency(migration, child, key) def detect_conflicts(self): """ |
