我將我的燒瓶應用程序部署到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