Only include migrations that need to run to preserve RAM.
Fixed indentation
Merge pull request #5492 from idmadj/4.2

Only include migrations that need to run to preserve RAM.