我从models.py中删除了两个模型,当我运行makemigrations并在本地迁移时,一切都很好。当我在Heroku上运行makemigrations时,我收到以下消息,其中Building和BuildingInstance是我删除的模型:
Migrations for 'hello':
0002_building_buildinginstance.py:
- Create model Building
- Create model BuildingInstance
当我运行迁移时,我得到:
Running migrations:
No migrations to apply.
Your models have changes that are not yet reflected in a migration, and so won't be applied.
Run 'manage.py makemigrations' to make new migrations, and then re-run 'manage.py migrate' to apply them.
答案 0 :(得分:1)
正如我在这里多次写过的那样,你一定不能在Heroku上运行makemigrations。在本地运行,提交结果,然后在Heroku上运行migrate。