Ben Lisbakken
2006-Sep-12 21:19 UTC
In migrations, how do I change the length of a string?
I want to do: t.column :title, :string, :length => 100 or t.column :title, :string, :size => 100 How do I do it? Also, where is some documentation about migrations? http://api.rubyonrails.com/classes/ActiveRecord/Migration.html That doesn''t tell me stuff I want to know! Thanks! Ben Lisbakken --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ian Leitch
2006-Sep-12 21:25 UTC
Re: In migrations, how do I change the length of a string?
:limit => 100 On 12/09/06, Ben Lisbakken <lisbakke-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > I want to do: > t.column :title, :string, :length => 100 > or > t.column :title, :string, :size => 100 > > How do I do it? > > Also, where is some documentation about migrations? > http://api.rubyonrails.com/classes/ActiveRecord/Migration.html > That doesn''t tell me stuff I want to know! > > Thanks! > > Ben Lisbakken > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Nathan Leach
2006-Sep-12 21:54 UTC
Re: In migrations, how do I change the length of a string?
Ben, I think you want to either specify the size in parens ":string(80)" or using the limit option ":limit => 80". Try and see which one works for you. Nathan -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org]On Behalf Of Ben Lisbakken Sent: Tuesday, September 12, 2006 4:20 PM To: Ruby on Rails: Talk Subject: [Rails] In migrations, how do I change the length of a string? I want to do: t.column :title, :string, :length => 100 or t.column :title, :string, :size => 100 How do I do it? Also, where is some documentation about migrations? http://api.rubyonrails.com/classes/ActiveRecord/Migration.html That doesn''t tell me stuff I want to know! Thanks! Ben Lisbakken --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---
Ben Lisbakken
2006-Sep-12 21:56 UTC
Re: In migrations, how do I change the length of a string?
Thanks guys, :limit did it for me. How come there''s no documentation on it on the api? How come the API doesn''t list all the types (like :integer, :string, :text, :datetime etc.)? -Ben --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Aaron Baldwin
2006-Sep-12 22:03 UTC
Re: In migrations, how do I change the length of a string?
On Sep 12, 2006, at 3:56 PM, Ben Lisbakken wrote:> > Thanks guys, :limit did it for me. How come there''s no documentation > on it on the api? How come the API doesn''t list all the types (like > :integer, :string, :text, :datetime etc.)? > > -Ben >Take a look at this. Aaron --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Ben Lisbakken
2006-Sep-12 22:32 UTC
Re: In migrations, how do I change the length of a string?
Thanks aaron! -Ben --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Aaron Baldwin
2006-Sep-12 22:46 UTC
Re: In migrations, how do I change the length of a string?
On Sep 12, 2006, at 4:03 PM, Aaron Baldwin wrote:> Take a look at this. >Just posting the actual url: http://api.rubyonrails.com/classes/ActiveRecord/ConnectionAdapters/ TableDefinition.html --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---