jeudi 9 avril 2015

Number is out of range for ActiveRecord::Type::Integer with limit 4

I'm using SQLite + ActiveRecord in my Ruby app, and here's the error I get while trying to write a big number to the integer field:



1428584647765 is out of range for ActiveRecord::Type::Integer with limit 4



But according to SQLite docs:



The value is a signed integer, stored in 1, 2, 3, 4, 6, or 8 bytes depending on the magnitude of the value.



8 bytes is a plenty of space to store 1428584647765 number, so why does ActiveRecord give me an error? Why does it think that this is a 4-byte field?


Aucun commentaire:

Enregistrer un commentaire