Skip to content Skip to sidebar Skip to footer

Django, Manytomanyfield - Programmingerror: Relation Foo_bar Does Not Exist. Recognized In Migrations, Though Relation Is Never Created

In this case, 'foo_bar' is actually 'links_userprofile_favorite_feeds'. The problem is, when I go into manage.py shell: manage.py shell from django.contrib.auth.models import User

Solution 1:

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

Post a Comment for "Django, Manytomanyfield - Programmingerror: Relation Foo_bar Does Not Exist. Recognized In Migrations, Though Relation Is Never Created"