Implement `self.next_migration_number` in migration generator

For Rails 4 compatibility