For Rails migrations, I avoid using models -- often, in the future that model is changed, renamed, or removed.
I do use SQL in my migrations though. I find the INSERT INTO ... SELECT pattern is ideal for migrations that require data changes.
9 months ago