migration to change data type of existing column from string to text

9 views
Skip to first unread message

sol.manager

unread,
May 17, 2011, 1:59:22 PM5/17/11
to Ruby on Rails: Talk
I have been poking around the rails guides section on migrations
(http://guides.rubyonrails.org/v2.3.8/migrations.html#changing-tables)
and trying to make sure I have the proper syntax to change a column
type for an existing field from string to text (without losing data
already entered). What is the proper syntax for this in a migration?

Let's say for this example, the table is named "posts" and the column
is named "apply_info"

sol.manager

unread,
May 17, 2011, 3:58:43 PM5/17/11
to Ruby on Rails: Talk
Well googled a bit more as I am impatient. Credit for this answer goes
to http://www.cowboycoded.com/2009/10/07/change-a-column-data-type-with-rails-migration/

Thanks cowboy.
Reply all
Reply to author
Forward
0 new messages