[Answered ]-Django, ManyToManyField – ProgrammingError: relation foo_bar does not exist. Recognized in migrations, though relation is never created

2👍

✅

Fixed.

For those with this problem in the future:

  1. Delete all links_* tables from the database (app was called ‘links’)
  2. Delete all migrations for the ‘links’ app by doing:

    from django.db.migrations.recorder import MigrationRecorder
    MigrationRecorder.Migration.objects.filter(app='links').delete()
    
  3. Migrated forward with manage.py migrate

Leave a comment