Ensured squashed migrations are recorded as applied when the migrate command is run and all of the original migrations have been previously applied. Backport of 69db1c745506bf63026def25d6854755179feaa8 from master