search

Home  >  Q&A  >  body text

python - django model中的ID字段如何设置自增的初始化值呢?

比如从100000000开始自增,因为是订单编号,确保必须唯一,然后16位,so..

PHP中文网PHP中文网2820 days ago1115

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-04-18 10:28:05

    Try to do this at the database level; for example, postgresql executes ALTER SEQUENCE sequence_name RESTART WITH 12345; then test it yourself. When the test is successful, create a new migration file and throw the statement into the migration file. You should know how to customize migration, and then over

    reply
    0
  • Cancelreply