[BUGFIX] Loop confuses variable check on migrating
When migrating code and not specifying a package to work on, the code
would get confused after the first available migration, because the
internal loop used $packageKey as well.
Releases: 1.1, 1.2