How to get Django AutoFields to start at a higher number

前端 未结 7 617
挽巷
挽巷 2020-12-02 19:15

For our Django App, we\'d like to get an AutoField to start at a number other than 1. There doesn\'t seem to be an obvious way to do this. Any ideas?

相关标签:
7条回答
  • 2020-12-02 20:08

    A quick peek at the source shows that there doesn't seem to be any option for this, probably because it doesn't always increment by one; it picks the next available key: "An IntegerField that automatically increments according to available IDs" — djangoproject.com

    0 讨论(0)
提交回复
热议问题