Django 1.7 - makemigrations not detecting changes

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

    People like me who don't like migrations can use steps below.

    1. Remove changes what you want to sync.
    2. Run python manage.py makemigrations app_label for the initial migration.
    3. Run python manage.py migrate for creating tables before you make changes.
    4. Paste changes which you remove at first step.
    5. Run 2. and 3. steps.

    If you confused any of these steps, read the migration files. Change them to correct your schema or remove unwanted files but don't forget to change next migration file's dependencies part ;)

    I hope this will help someone in future.

提交回复
热议问题