Django 1.7 - makemigrations not detecting changes

前端 未结 29 1442
忘了有多久
忘了有多久 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:53

    Maybe that can help someone, I had the same problem.

    I've already created two tables with the serializer class and the views. So when I wanted to updated, I had this error.

    I followed this steps:

    1. I made .\manage.py makemigrations app
    2. I executed .\manage.py migrate
    3. I erased both tables of my models.py
    4. I erased all reference to my tables from serializer and view class.
    5. I executed step 1 and 2.
    6. I retrieved my changes just in the models.py
    7. I executed again step 5.
    8. I restored all my changes.

    If you're working with Pycharm, local history is very helpfull.

提交回复
热议问题