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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With