[Fixed]-Big integer field in django models


SQLite won’t complain ever. it uses ‘manifest typing’, that is, the values have type, not the columns. It lets you store bigtext on a smallint collumn, or whatever you want! (except if you define an integer primary key, where it uses a 64-bit integer).

that’s a very convenient feature, but it makes a SQLite bad choice for developing if you’re going to deploy with a different engine.

for using a BIGINT, you’d have to create a custom field class. unfortunately, that part has changed on Django 1.0, so you’d have to rewrite it if/when you update.



BigIntegerField was added in changeset 11887, 2009-12-17 09:10:38 and is part of Django 1.2 and newer.


Try a DecimalField.

Leave a comment