django.db.utils.IntegrityError: duplicate key value violates unique constraint “django_content_type_pkey”

前端 未结 5 1794
春和景丽
春和景丽 2020-12-31 00:43

Ran into a bit of a problem, i\'m getting the above error message when i run \'python manage.py syncdb\' I\'m working on a fairly old site. It\' running django

5条回答
  •  心在旅途
    2020-12-31 01:35

    From the inspiration of Wolph, here is my fix.

    SELECT setval('django_migrations_id_seq', (SELECT MAX(id) FROM django_migrations));
    

提交回复
热议问题