Strongly agree with regis here, we don't want model code in our migrations, it ties our hands pretty tight when it comes to renaming models. (you can't) SQL will be fine for string manipulation, has regex support and lots of other goodies.