Change column to allow null

how do I change the column in a table to allow null?

I have

change_column :docs, :orga,    :null

in my migration file but I get an error:

Mysql::Error: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near ‘null DEFAULT ‘’ NOT NULL’ at line 1: ALTER TABLE docs
CHANGE orga `orga null DEFAULT ‘’ NOT NULL

Actually, I had :null=> true

On 23 March 2010 16:11, ES [email protected] wrote:

Actually, I had :null=> true

On Mar 23, 5:01 pm, ES [email protected] wrote:

how do I change the column in a table to allow null?

I have

change_column :docs, :orga,    :null

If you check the docs for change_column you will see that you need the
column type even if it has not changed
change_column :docs, :orga, whatever_type_it_is :null=>true

Colin

cool thanks

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