How to reset the primary key sequence in PostgreSQL with Django
I was working on some fairly big features involving new Django models for one of our apps and when I pushed to our staging environment, I got this error during deployment at the database migration step:
duplicate key value violates unique constraint "auth_permission_pkey" DETAIL: Key (id)=(55) already exists
It looks like new records were getting added to the auth_permission table. I was puzzled as I didn't make any changes related to the Django auth app. …