views:

22

answers:

1

It looks like string is limited to 256 characters and text is usually 65536 characters.

I tried

ruby script/generate migration change_description_to_text description:text

but the up and down in the migration file generated are both empty? Is there a way to generate this migration automatically?

If added manually using a remove_column and an add_column, will all the old data be removed for the column?

+2  A: 

see the way of using migration itself wrong,

because you are changing the description string into text but u didnt specify which table so

use as following method.

ruby script/generate migration change_description_string_to_text

in migration,

def self.up
    change_column :user, :description, :text
  end

  def self.down
    change_column :user, :description, :string
  end
Senthil Kumar Bhaskaran