I ran into the same problem, and the answer above gave me a clue on how I fixed mine. I propose my answer a little detailed to solving the problem.
You can do this by setting limit on your table column.
Hack/Steps
-
Run a migration to change your table column. e.g.
rails generate migration change_integer_limit_in_your_table
Note:
your_table
in the code will be your table name in plural -
Edit the generated migration such that the generated migration will look like this:
class ChangeIntegerLimitInYourTable < ActiveRecord::Migration def change change_column :your_table, :your_column, :integer, limit: 8 end end
Note: The limit of 8 in the code is the storage size which can range from -9223372036854775808 to +9223372036854775807 and called
bigint
i.e. large-range integer. -
Run
rake db:migrate
to migrate your database. -
Restart your server by running
rails server
and you are up and running.
For more information on Numeric Type, see https://www.postgresql.org/docs/9.4/static/datatype-numeric.html