Rearrange imports in previous migration.

According to mg bad things can happen if you try to do stuff outside of a
migration's upgrade() function.