Reputation: 245
I am using the custom user model which inherits from the AbstractBaseUser class. When I try to migrate after makemigrations command
django.db.utils.ProgrammingError: relation "custom_user_users" does not exist
This is happening since Django is trying to migrate other apps first which depends upon the custom user model. Even I tried to changing the order of the app which contains the custom user model in INSTALLED_APP but no luck.
I know I can force fully migrate custom_user model first then let Django migrate all other models. This solves the problem but during running test it runs the migration in order which Django decides.
How can I alter the order in which apps are migrated during test ? Any other way to solve this dependency problem ?
I am using Django 1.8
Upvotes: 7
Views: 3013
Reputation: 2703
https://pypi.python.org/pypi/django-test-without-migrations adds a --nomigrations flag to manage.py test. Works like a charm.
Upvotes: 1
Reputation: 607
Put your your apps before Django apps in INSTALLED_APP in settings.py file
Upvotes: 1