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)


 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)