Relying on large offsets can have uneven performance on huge table, new implementation recovers more cleanly and avoids double updates
In the previous commit 5222247 we added a topic_id column to EmailLog. This simply backfills it in batches. The next PR will get rid of the topic method defined on EmailLog in favour of belongs_to.
5222247