Django 1.7 - makemigrations not detecting changes

前端 未结 29 1500
忘了有多久
忘了有多久 2020-11-27 12:43

As the title says, I can\'t seem to get migrations working.

The app was originally under 1.6, so I understand that migrations won\'t be there initially, and indeed i

29条回答
  •  醉酒成梦
    2020-11-27 12:52

    My solution was not covered here so I'm posting it. I had been using syncdb for a project–just to get it up and running. Then when I tried to start using Django migrations, it faked them at first then would say it was 'OK' but nothing was happening to the database.

    My solution was to just delete all the migration files for my app, as well as the database records for the app migrations in the django_migrations table.

    Then I just did an initial migration with:

    ./manage.py makemigrations my_app

    followed by:

    ./manage.py migrate my_app

    Now I can make migrations without a problem.

提交回复
热议问题