Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #23008 -- Fixed typo causing bad migration dependencies.

Thanks semenov for the report and Florian for investigation.
  • Loading branch information...
commit 9a2ab629776735fae2c9184dc4b9d9029bad15b2 1 parent 671e0c9
@timgraham timgraham authored
View
4 django/db/migrations/autodetector.py
@@ -254,13 +254,13 @@ def _detect_changes(self, convert_apps=None, graph=None):
# If we can't find the other app, we add a first/last dependency,
# but only if we've already been through once and checked everything
if chop_mode:
- # If the app already exists, we add __last__, as we don't know which
+ # If the app already exists, we add __latest__, as we don't know which
# migration contains the target field.
# If it's not yet migrated or has no migrations, we use __first__
if graph and not graph.root_nodes(dep[0]):
operation_dependencies.add((dep[0], "__first__"))
else:
- operation_dependencies.add((dep[0], "__last__"))
+ operation_dependencies.add((dep[0], "__latest__"))
else:
deps_satisfied = False
if deps_satisfied:
View
2  tests/migrations/test_autodetector.py
@@ -1057,4 +1057,4 @@ def test_last_dependency(self):
self.assertOperationTypes(changes, 'otherapp', 0, ["CreateModel"])
self.assertOperationAttributes(changes, 'otherapp', 0, 0, name="Book")
# Right dependencies?
- self.assertEqual(changes['otherapp'][0].dependencies, [("migrations", "__last__")])
+ self.assertEqual(changes['otherapp'][0].dependencies, [("migrations", "__latest__")])
Please sign in to comment.
Something went wrong with that request. Please try again.