Why is the integer size limit different on Rails when using PostgreSQL v. MySQL?
mysql, postgresql, ruby, ruby-on-rails
Solution
The `smallint` type in PostgreSQL occupies two byte and accepts numbers from -32768 to +32767.
There is no `tinyint` like in MySQL that occupies 1 byte and accepts numbers from -128 to 127.
Problem
I'm migrating my app from MySQL to Postgres. If I do a `rake db:schema:load`, it loads fine into Postgres, and all my tests pass. If I do `rake db:migrate:reset`, then an integer column that I had previously set to have `:limit => 1` is set to have `:limit => 2`. My migration sets it like so: ``` t.integer "foo", :limit => 1, :null => false ``` Is it simply a matter of Postgres having a lower minimum size?