Use correct logic for determining range of migrations to run

The code for determining which migrations to run in an ActiveRecord
environment previously assumed that it should always start from the
first migration when migrating up.

Unless I'm very confused, it seems to me that in fact it should start
at the migration after the current one. This change implements that
functionality.