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

后端 未结 15 1548
离开以前
离开以前 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:31

    Sounds like your initial migration was faked because the table already existed (probably with an outdated schema):

    https://docs.djangoproject.com/en/1.7/topics/migrations/#adding-migrations-to-apps

    "This will make a new initial migration for your app. Now, when you run migrate, Django will detect that you have an initial migration and that the tables it wants to create already exist, and will mark the migration as already applied."

    Otherwise you would get an no-such-table error :)

    [edit] did you clean up the applied-migrations table? That's also a common cause for non-applied migrations.

提交回复
热议问题