As many of us, I was writing data migrations as a part of database schema migrations.
That’s a bad practice, and here is how I perform the same nowadays.
Migration from the plain text fields to rich text fields with ActiveText. How?
Steps 1-2-3 are done within a single new PR. Once the schema is in the new state, I perform rake tasks for data movement.
The subsequent PR just tears down old fields and voila.