Klaas van Schelven avatar Klaas van Schelven committed 99b4cdd

'checked' is probably only checked in the context of last

so the performance fix should not 'fix' too much

Comments (2)

  1. shaib

    Actually, I think this is wrong; when a migration has already been 'checked' (even in the context of a different 'last'), it is either found to have been done (so no need to check again) or has already been found as not done and reported (and then, adding it as a problem a second time is mostly noise).

    Do you prefer to have an output that says:

    ! Migration X should not have been applied before A but was.
    ! Migration X should not have been applied before B but was.
    ! Migration X should not have been applied before C but was.
    

    I think one of these is enough to indicate the problem (and IIRC, South will refuse to run migrations until the issue is fixed, even if there is only one problem).

  2. Andrew Godwin repo owner

    Yes, I agree with Shai - the way the code is written it can easily do earliest-abort, and if we lose a few extra messages along the way in return for speeding up every migrate run, I say that's fine.

Files changed (1)

south/migration/__init__.py

 def inner_problem_check(problems, done, verbosity):
     "Takes a set of possible problems and gets the actual issues out of it."
     result = []
-    checked = set([])
     for last, migration in problems:
+        checked = set([])
         # 'Last' is the last applied migration. Step back from it until we
         # either find nothing wrong, or we find something.
         to_check = list(last.dependencies)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.