Integer out of range

django, python

Solution

Try using BigIntegerField if you integers are that big. From the documentation:

A 64 bit integer, much like an IntegerField except that it is guaranteed to fit numbers from -9223372036854775808 to 9223372036854775807. The admin represents this as an `<input type="text">` (a single-line input).

Problem

I'm getting an `integer out of range` error when trying to migrate my database from SQLite to PostgreSQL. I think I have pinpointed the problem: I have some huge integers in a `IntegerField` field in my model. Basically on the order of 52675215334. When I change this value to a small number like 1 and then try to migrate my database, all is fine. Is there some other data type I should be using other than IntegerField to store these large values?

Original source

Related problems