Migration: updating a column

Hi,

Is there a way to “update” a column?

Here’s what I mean:
I have a column name “item” in table “products” of type “integer”
Now I want to update the column to have the option “:null => false”

So far, the only way I have found is to remove it and re-add it, but
obviously that is quite dumb.

Have you tried change_column in a migration?

http://api.rubyonrails.org/classes/ActiveRecord/Migration.html

Thanks.

I was under the impression that change_column was only for renaming.

On 29 July 2010 15:42, Eric Y. [email protected] wrote:

Thanks.

I was under the impression that change_column was only for renaming.

Please don’t top post on this list. Thanks.
rename_column is for renaming, change_column is for changing the
attributes of the col.

Column

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs