Fix migrateOldVersionApp performance

Instead of checking the number of documents in the old database, check the last seq number.