views:

21

answers:

1

Trying to migrate a sqlite3 db for a rails app to mysql db. The column named "content" was a string type in sqlite3. I want to change it to varchar (or perhaps text) in mysql. I am not sure if there is a way to do this by using "ruby script/generate" command. Any ideas? Obviously, I could start all over again with desired column types but wondering if there is a better way.

Thanks.

Raj

+1  A: 

If you've defined your column type as a string in your schema, then it will already be a VARCHAR in mysql. If you want to change it to a text field, create a migration using something like script/generate Migration ChangeModelxContentToText and then use change_column to change it.

Beerlington