Python 在heroku上合并不同的alembic修订头失败

Python 在heroku上合并不同的alembic修订头失败,python,heroku,alembic,Python,Heroku,Alembic,我正在修改一个烧瓶应用程序 在开发过程中,我在本地删除了几次迁移文件夹和sqllite db。我把我的技术推给了赫罗库 尝试迁移heroku postgresdb时: $ heroku run python manage.py db upgrade ..... alembic.util.CommandError: Multiple head revisions are present for given argument 'head'; please specify a specific tar

我正在修改一个烧瓶应用程序

在开发过程中,我在本地删除了几次迁移文件夹和sqllite db。我把我的技术推给了赫罗库

尝试迁移heroku postgresdb时:

$ heroku run python manage.py db upgrade
.....
alembic.util.CommandError: Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '<branchname>@head' to narrow to a specific head, or 'heads' for all heads
然后我试着:

$ heroku run python manage.py db upgrade
Running python manage.py db upgrade on myapp... up, run.7021
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
    ....
    "%s@head" % branch_label if branch_label else "head")
alembic.util.CommandError: Multiple head revisions are present for given argument 'head'; please specify a specific target revision, '<branchname>@head' to narrow to a specific head
, or 'heads' for all heads
$heroku运行python manage.py数据库升级
正在myapp上运行python manage.py db升级。。。起来,跑
信息[alembic.runtime.migration]上下文impl PostgresqlImpl。
INFO[alembic.runtime.migration]将采用事务DDL。
....
"%s@head%branch\u标签(如果branch\u标签为“head”)
alembic.util.CommandError:给定参数“head”存在多个head修订;请指定特定的目标版本,“@head”以缩小到特定的head
,或所有头部的“头部”

如何将修订头合并为一个,并确保它与我的开发版本同步?

我联系了heroku支持部门,并获得了以下回复(对我来说很有用):

要从本地存储库中删除文件夹,需要运行git rm。你能试试下面的吗

$ git rm -r migrations
$ git commit -m 'Remove migrations directory'
$ git push heroku master
要查看实际文件和注册到本地存储库中的文件之间的差异,git状态可能很有用


如果您在这里遇到任何困难,请告诉我们。

我联系了heroku支持部门,并获得了以下信息(对我有效):

要从本地存储库中删除文件夹,需要运行git rm。你能试试下面的吗

$ git rm -r migrations
$ git commit -m 'Remove migrations directory'
$ git push heroku master
要查看实际文件和注册到本地存储库中的文件之间的差异,git状态可能很有用

如果您在这里遇到任何困难,请告诉我们