cursor "_django_curs_1696_sync_2" does not exist

Viewed 81

I accidentally deleted my migrations. I later makemigrations and migrate but when I access certain parts of the app that have ForeignKey references, I get cursor "_django_curs_1696_sync_2" does not exist. How on earth would I go about getting this corrected. This is happening in development and so I fear pushing to production because the same error will arise.? I tried looking at similar questions but couldn't get one to help solve my problem.

1 Answers

The simplest solution to this problem

  1. Delete All files in all app migration folder (Except _ _ init _ _ .py)
  2. If use Docker Delete DB Volumes, Else Delete Your DB
  3. ReCreate the Database
  4. Run $Python manage.py makemigrations
  5. Run $Python manage.py migrate
  6. Enjoy IT
Related