views:

501

answers:

1

In Rails Migrations, what does the number specified for the :limit parameter on an integer represent? Is it the number of bytes or the number of digits?

i.e. If I were to specify the following:

t.integer :coefficient, :limit => 2

Does that mean the SQL database will reserve two bytes for each integer, or that each integer can not have more than two digits? I'm assuming it means bytes, but I'm not positive.

Thanks!

+3  A: 

According to the documentation, it's the number of characters for :string and :text columns and the number of bytes for :binary and :integer columns.

John Topley