Typecast values on change_column for postgresql


Currently if you have a string column that have only number values (think a year column using string by mistake) and you want to change to integer, you can’t.

If you apply this monkey-patch will be possible: https://gist.github.com/1393441

Note: if some value can’t be casted by postgresql (if have a letter for example), the migration will fail as expected.

I think this is the expected behavior on change_column and I’m not sure but I guess mysql already does that.

What you think?

No opinions about that?

It is a useful functionality. Looks good to me.

Thumbs up.