Rails migration bug?
It seems that if you do:
rename_column :accounts, :username, :user_name
change_column :accounts, :user_name, :string, { :null => false,
:default => "", :limit => 25 }
you get a different result to if you do:
change_column :accounts, :username, :string, { :null => false,
:default => "", :limit => 25 }
rename_column :accounts, :username, :user_name
(i.e. the rename happens after the column change)
It seems your change_column gets forgotten about if you do the rename afterwards. The fix: do the rename first. I don’t know how to report ruby bugs, and I can’t be bothered fixing this particular one (it has a fairly simple workaround). Just thought I’d write about it. For fun. (I can also see how this bug came about.)
Oh yeah, the Rails migration thing is pretty cool.