Setting initial value of a autoincrement field in the database

170 views
Skip to first unread message

Anurag Baidyanath

unread,
Jun 19, 2014, 1:14:17 PM6/19/14
to django...@googlegroups.com
I have a field in my models.py file as follows

ticket_id = models.AutoField(primary_key=True)

The value for the ticket_id column starts at 1. say i wanted it to start from some value (say 989) . how do i accomplish this using django?

C. Kirby

unread,
Jun 19, 2014, 1:47:51 PM6/19/14
to django...@googlegroups.com
You can't do it in Django directly. If you need to do it you have to go to your DB and use whatever functionality it supports to set an auto id start point.
Reply all
Reply to author
Forward
0 new messages