Django 1.7 - makemigrations not detecting changes

前端 未结 29 1435
忘了有多久
忘了有多久 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 13:01

    Ok, looks like I missed an obvious step, but posting this in case anyone else does the same.

    When upgrading to 1.7, my models became unmanaged (managed = False) - I had them as True before but seems it got reverted.

    Removing that line (To default to True) and then running makemigrations immediately made a migration module and now it's working. makemigrations will not work on unmanaged tables (Which is obvious in hindsight)

提交回复
热议问题