Search code examples
django

Django Migration Issue With Abstract User


I have created Django application it was working fine at start but now i am facing migration issue with abstract user i remove the migrations files and database from my project and then remigrate it the issue still exist

Please any one help me to solve the problem


Solution

  • If i am not wrong i suggest you to try migrations in this order.

    STEPS

    1. Delete all migrations from apps.
    2. Remove db
    3. Lets say your AbstractUser model is in app accounts and you have other two apps like products and sales
    4. When you user model is abstract, you need to migrate users app first
    5. Example Commands
    python manage.py makemigrations accounts products sales
    python manage.py migrate 
    

    I hope that will solve your issue.