我将我的烧瓶应用程序部署到heroku中。 当我运行这个命令时,我得到一个错误。如何通过migraions id链接两个迁移并创建线性链以折叠分支?
heroku run python manage.py deploy
这是错误消息:
raise util.CommandError('Only a single head is supported. The ' alembic.util.CommandError: Only a single head is supported. The script directory has multiple heads (due to branching), which must be resolved by manually editing the revision files to form a linear sequence. Run alembic branches to see the divergence(s).
敖我GOOGLE了它,然后我得到这个:
this happens when you go back to a revision that is not the last and then create a new migration. Now you have two branches, which Alembic cannot handle.Look at how the migration files are chained together through migration ids, you need to create a linear chain to collapse the branches.
但我仍然感到困惑如何解决。 我认为这个问题是由git分支造成的。 (我试图合并两个分支,但没有工作?)
您最有可能在将这些分支合并回主(或您使用的任何分支)之前,在两个不同分支中生成迁移。现在你有两次迁移,声称是在Heroku中运行的最后一个迁移之后运行的迁移。您可以使用['alembic merge'命令](http://alembic.readthedocs.io/en/latest/branches.html#merging-branches)来修复它。 – dirn