I have a working Django 1.6 project that I'm upgrading to 1.8. I have a custom user model in app mainapp
that looks like this:
class CustomUser(AbstractBaseUser, PermissionsMixin):
...
manage.py migrate
or syncdb
fail with the following error:
Operations to perform:
Synchronize unmigrated apps: gis, gunicorn, staticfiles, guardian, messages, captcha, corsheaders, bootstrapform
Apply all migrations: sessions, admin, sites, auth, contenttypes, mainapp
Synchronizing apps without migrations:
Creating tables...
Creating table guardian_userobjectpermission
Creating table guardian_groupobjectpermission
Creating table corsheaders_corsmodel
Running deferred SQL...
...
django.db.utils.ProgrammingError: relation "auth_permission" does not exist
I followed the answer in Django 1.8 RC1: ProgrammingError when creating database tables and ran makemigrations for the app (and all the other apps that can be migrated, including auth
). No changes are detected for any of them and migrate
continues to fail after this. How can I correct this?
HACKY WORKAROUND:
I can get the project running by commenting out all my apps in INSTALLED_APPS
, then adding them in a specific order and running migrate
as I go along. WTF... there has to be a proper way to do this.