So I''m using a column in my database to serialize a hash of extra data about an object. Stuff I''d want when displaying, but not anything else I care to have structured access to in my DB. I recently started storing an URL in field, so I decided I''d better change the column type from string (which it probably should never have been) to text. I did so with a standard migration def self.up change_column :my_table, :related_data, :text end Looking in my schema.db file, I see: t.text "related_data", :limit => 255 I think I know how to fix it, but want some reinforcement I''m on the right track before I spend the time. Looks like what I really need is: def self.up add_column :my_table, :new_related_data, :text # copy data from related_data to new_related_data remove_column :my_table, :related_data rename_column :my_table, :new_related_data, :related_data end yes? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/xpW-_gCnng8J. 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.
On Aug 17, 2011, at 3:32 PM, John Hinnegan wrote:> So I''m using a column in my database to serialize a hash of extra data about an object. Stuff I''d want when displaying, but not anything else I care to have structured access to in my DB. I recently started storing an URL in field, so I decided I''d better change the column type from string (which it probably should never have been) to text. > > I did so with a standard migration > > def self.up > change_column :my_table, :related_data, :text > end > > Looking in my schema.db file, I see: > > t.text "related_data", :limit => 255 > > I think I know how to fix it, but want some reinforcement I''m on the right track before I spend the time. Looks like what I really need is: > > def self.up > add_column :my_table, :new_related_data, :text > # copy data from related_data to new_related_data > remove_column :my_table, :related_data > rename_column :my_table, :new_related_data, :related_data > end > > yes?Or just... change_column :my_table, :related_data, :text, :limit => 123456789 # or whatever you think is large enough -philip -- 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.
That would be easier for sure. I was just guessing that the limit param was put in because the db was just changing the type on the column, not actually changing the size allocated to the column per record. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/wMVXOy2YPpoJ. 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.
On Aug 17, 2011, at 7:38 PM, Philip Hallstrom wrote:> > On Aug 17, 2011, at 3:32 PM, John Hinnegan wrote: > >> So I''m using a column in my database to serialize a hash of extra >> data about an object. Stuff I''d want when displaying, but not >> anything else I care to have structured access to in my DB. I >> recently started storing an URL in field, so I decided I''d better >> change the column type from string (which it probably should never >> have been) to text. >> >> I did so with a standard migration >> >> def self.up >> change_column :my_table, :related_data, :text >> end >> >> Looking in my schema.db file, I see: >> >> t.text "related_data", :limit => 255 >> >> I think I know how to fix it, but want some reinforcement I''m on >> the right track before I spend the time. Looks like what I really >> need is: >> >> def self.up >> add_column :my_table, :new_related_data, :text >> # copy data from related_data to new_related_data >> remove_column :my_table, :related_data >> rename_column :my_table, :new_related_data, :related_data >> end >> >> yes? > > Or just... > > change_column :my_table, :related_data, :text, :limit => 123456789 > # or whatever you think is large enough > > -philipI think that the limit can be 2048 as I recall that is the max for a URL. I can''t find a reference to back that up at the moment, but I think that this is what the sitemap specification (see Google) allows, too. -Rob Rob Biedenharn Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org http://AgileConsultingLLC.com/ rab-/VpnD74mH8+00s0LW7PaslaTQe2KTcn/@public.gmane.org http://GaslightSoftware.com/ -- 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.
>>> So I''m using a column in my database to serialize a hash of extra data about an object. Stuff I''d want when displaying, but not anything else I care to have structured access to in my DB. I recently started storing an URL in field, so I decided I''d better change the column type from string (which it probably should never have been) to text. >>> >>> I did so with a standard migration >>> >>> def self.up >>> change_column :my_table, :related_data, :text >>> end >>> >>> Looking in my schema.db file, I see: >>> >>> t.text "related_data", :limit => 255 >>> >>> I think I know how to fix it, but want some reinforcement I''m on the right track before I spend the time. Looks like what I really need is: >>> >>> def self.up >>> add_column :my_table, :new_related_data, :text >>> # copy data from related_data to new_related_data >>> remove_column :my_table, :related_data >>> rename_column :my_table, :new_related_data, :related_data >>> end >>> >>> yes? >> >> Or just... >> >> change_column :my_table, :related_data, :text, :limit => 123456789 # or whatever you think is large enough >> >> -philip > > > I think that the limit can be 2048 as I recall that is the max for a URL. I can''t find a reference to back that up at the moment, but I think that this is what the sitemap specification (see Google) allows, too.http://support.microsoft.com/kb/q208427/ Relevant portion..... Microsoft Internet Explorer has a maximum uniform resource locator (URL) length of 2,083 characters. Internet Explorer also has a maximum path length of 2,048 characters. This limit applies to both POST request and GET request URLs. If you are using the GET method, you are limited to a maximum of 2,048 characters, minus the number of characters in the actual path. However, the POST method is not limited by the size of the URL for submitting name/value pairs. These pairs are transferred in the header and not in the URL. -- 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.
On 19 August 2011 17:35, Philip Hallstrom <philip-LSG90OXdqQE@public.gmane.org> wrote:>> I think that the limit can be 2048 as I recall that is the max for a URL. I can''t find a reference to back that up at the moment, but I think that this is what the sitemap specification (see Google) allows, too. > > http://support.microsoft.com/kb/q208427/ > > Relevant portion..... > > Microsoft Internet Explorer has a maximum uniform resource locator (URL) length of 2,083 characters. Internet Explorer also has a maximum path length of 2,048 characters. This limit applies to both POST request and GET request URLs.That''s the current limit for IE - but IE is not the internet. If you check section 3.2.1 of the HTTP RFC, it states: "The HTTP protocol does not place any a priori limit on the length of a URI." and also notes that "Servers should be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations may not properly support these lengths" So essentially the limit is whatever combination of current clients can send, and your server can handle. Over time, I''d assume it will get longer, as more http clients support longer URIs, and more people rely on them in their apps. -- 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.
On 20 August 2011 09:32, Michael Pavling <pavling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> If you check section 3.2.1 of the HTTP RFC, it states:It would''ve been polite to include the link! :-) http://www.faqs.org/rfcs/rfc2068.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-/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.