Replace all() with iterator()

all() caches all results, and not only is this not needed or beneficial
for migrations, it also means the migration tries to load the entire
table into memory. This can kill the box as it struggles to get enough
swap memory for the task.

Change-Id: I62e7a4c68eeeebf6e6b93860ac1ac4ebf77c5542