Django 1.7 - “No migrations to apply” when run migrate after makemigrations

后端 未结 15 1559
离开以前
离开以前 2020-11-28 20:46

I use Django1.7 with Mezzanine. I create simple profile (according to Mezzanine documentation) stored in separate app \"profiles\":

class RoadmapProfile(mode         


        
15条回答
  •  春和景丽
    2020-11-28 21:50

    In my case I wrote like this:

    python manage.py makemigrations --empty yourappname

    python manage.py migrate yourappname

    or:

    Django keeps track of all the applied migrations in django_migrations table. So just delete all the rows in the django_migrations table that are related to you app like:

    DELETE FROM django_migrations WHERE app='your-app-name'

    and then do:

    python manage.py makemigrations python manage.py migrate

提交回复
热议问题