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?
The
smallinttype in PostgreSQL occupies two byte and accepts numbers from -32768 to +32767.There is no
tinyintlike in MySQL that occupies 1 byte and accepts numbers from -128 to 127.