logo       

Table Definition - Better binary support w/MySQL: msg#00220

lang.ruby.rails.core

Subject: Table Definition - Better binary support w/MySQL


I work with Rails purely on MySQL, so I can't say how this is handled
with Oracle, DB2, etc. However, when you create table columns with
rails, you may specify :string, :text, or :binary, with or without
:limits.

In the case of :string, setting the limit uses varchar(N) appropriately
up until 65,532, at which point it switches over to mediumtext as it
should. With :text, it will use tinytext up until a limit of 255 - if
you specify :limit => 500, for instance, it is smart enough to switch
to text.

However, when using :binary, limits of under 255 get tinyblob, then
switch over to blob. What I would propose is that with the :binary
type, when limits are specified, VARBINARY (equivalent to VARCHAR)
should be used, as it saves space, and is the most appropriate type.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to rubyonrails-core@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core
-~----------~----~----~----~------~----~------~--~---




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise