sol.manager
2011-May-17 17:59 UTC
migration to change data type of existing column from string to text
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" -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
sol.manager
2011-May-17 19:58 UTC
Re: migration to change data type of existing column from string to text
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. On May 17, 1:59 pm, "sol.manager" <sol.mana...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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"-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.