On Wed, Nov 11, 2009 at 1:55 AM, Thomas Gendulphe
<[email protected]> wrote:

> With Rails 2.3.4 and MySQL 5.0.41:
>
> | id                            | int(11)      | NO   | PRI | NULL    | 
> auto_increment |
> | author_id               | int(11)      | YES  |     | NULL    |             
>    |

...
>    t.integer  "author_id"
>    t.integer  "author_bet_id"

> Why the hell is the size limit lost?

Because it's basically meaningless?  :-)
---------------
via http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html :

 Another extension is supported by MySQL for optionally specifying the
display width of integer data types in parentheses following the base
keyword for the type (for example, INT(4)). This optional display
width may be used by applications to display integer values having a
width less than the width specified for the column by left-padding
them with spaces. (That is, this width is present in the metadata
returned with result sets. Whether it is used or not is up to the
application.)

The display width does not constrain the range of values that can be
stored in the column, nor the number of digits that are displayed for
values having a width exceeding that specified for the column. For
example, a column specified as SMALLINT(3) has the usual SMALLINT
range of -32768 to 32767, and values outside the range allowed by
three characters are displayed using more than three characters.
---------------

Reading The Fine Manual -- priceless  :-)

-- 
Hassan Schroeder ------------------------ [email protected]
twitter: @hassan

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to