You ill have to start by asking about your specific database, preferably
from someone who knows that database definitively.  The id field is generally
set up to be automatically populated using a database sequence object, so
one question is whether your database's sequences can be bigint.  Another
is whether it has restrictions on foreign key field sizes, since by default they
are in the id field.  And the unique constraint is typically implemented in an
index, so you would need to confirm that you can have an index on a bigint.

I suspect that most databases support all of these, but you should check
in the case of yours.

So long as the ORM supports your db's bigints at all, which I believe is a
function of the database back end, python deals with int versus long
transparently, especially in the newer versions.

But test.

Bill

On Sun, Mar 13, 2011 at 12:02 AM, Andy <selforgani...@gmail.com> wrote:
> I have a model that may have a lot (billions) of records. I understand
> that the "id" field of a model is defined as a 32-bits int. So it may
> not be big enough.
>
> Is it safe to just ALTER the database schema to change the "id" field
> from int to bigint? Would Django break? What happens when the "id"
> value returned by the database is larger than 32 bits, would Django be
> able to handle that?
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to