我最近向我的应用程序 (UserProfile) 添加了一个模型,当我将更改推送到 Heroku 时,我想我不小心运行了 heroku run python manage.py makemigrations
。现在,当我尝试运行 heroku run python manage.py migrate
时,出现以下错误
(leaguemaster) benjamins-mbp-2:leaguemaster Ben$ heroku run python manage.py migrate
Running `python manage.py migrate` attached to terminal... up, run.1357
Operations to perform:
Synchronize unmigrated apps: allauth
Apply all migrations: auth, admin, socialaccount, sites, accounts, account, contenttypes, sessions, leagueapp
Synchronizing apps without migrations:
Creating tables...
Installing custom SQL...
Installing indexes...
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.
我该如何解决?请帮忙!
原文由 Ben 发布,翻译遵循 CC BY-SA 4.0 许可协议
您需要首先在本地创建迁移,将它们添加到您的存储库,使用新迁移提交文件,然后推送到 heroku。
序列是这样的: