I am preparing a model as follows:
class SomeModel(models.Model):
id = models.BigIntegerField(primary_key=True, null=False, unique=True)
But my primary key must be a valid 9+ digit integer value. If I set the start index as 100000000
. then any value generated as id
will be 9 digit or greater in length.
But django do not support this. How can I implement this with minimum direct interference to django?
I am using Django 1.3
and Postgresql 9.1
I'm not a django user but I think the postgresql command you are looking for is:
ALTER SEQUENCE big_integer_seq RESTART 100000000;
Best to read the documentation for django/postgresql.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With