Django 1.7 - makemigrations not detecting changes

前端 未结 29 1444
忘了有多久
忘了有多久 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条回答
  •  Happy的楠姐
    2020-11-27 13:04

    Agree with @furins. If everything seems to be in order and yet this problem arises, checkout if there is any property method with same title as the attribute which you are trying to add in the Model class.

    1. Remove method with similar name as attribute you are adding.
    2. manage.py makemigrations my_app
    3. manage.py migrate my_app
    4. Add the methods back.

提交回复
热议问题