[Ruby] AR migration problems? was: refactoring/drying help
Jack Danger Canty
seattle.rb at 6brand.com
Thu Oct 11 16:37:42 PDT 2007
On 10/11/07, Ryan Davis <ryand-ruby at zenspider.com> wrote:
>
>
> On Oct 11, 2007, at 15:55 , Jack Danger Canty wrote:
>
> > If this is in an ActiveRecord migration I'd probably do it with
> > straight
> > SQL. I've had bad experiences with relying on models in migrations
> > when the
> > model code can change.
>
> such as?
In my current day job we've done significant rearrangements of the schema at
least a couple times. Migration #39 made perfect sense when we created it
but by #189 none of that model's relationships were named the same thing
(and most of them didn't even exist). We brought someone in to help out
once and it was less than delightful to find out that he couldn't run the
migrations from version 0.
I still use all the column management features of ActiveRecord::Migration
but I only use SQL for doing any sort of data management.
Bonus feature: the migrations are much smaller and a little faster.
::Jack Danger
More information about the Ruby
mailing list