Django model instances primary keys do not reset to 1 after all instances are deleted

前端 未结 7 755
说谎
说谎 2020-11-29 05:27

I have been working on an offline version of my Django web app and have frequently deleted model instances for a certain ModelX.

I have done this from the admin page

7条回答
  •  野性不改
    2020-11-29 05:49

    Another solution for 'POSTGRES' DBs is from the UI. Select your table and look for 'sequences' dropdown and select the settings and adjust the sequences that way.

    example:

    picture from pgadmin

提交回复
热议问题