【发布时间】:2017-07-14 10:34:00
【问题描述】:
我在一个使用 alembic 管理数据库迁移的团队中工作。我最近拉了master,并尝试运行alembic upgrade heads。我收到以下消息;
INFO [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO [alembic.runtime.migration] Will assume transactional DDL.
ERROR [alembic.util.messaging] Requested revision a04c53fd8c74 overlaps with other requested revisions 453d88f67d34
FAILED: Requested revision a04c53fd8c74 overlaps with other requested revisions 453d88f67d34
当我尝试运行 alembic downgrade -1 时,我收到了同样的消息。运行 alembic history 会打印此内容;
453d88f67d34 -> a04c53fd8c74 (label_1, label_2) (head), Create such and such tables.
2f15c778e709, 9NZSZX -> 453d88f67d34 (label_1, label_2) (mergepoint), empty message
b1861bb8b23f, b8aa3acdf260 -> 2f15c778e709 (label_1, label_2) (mergepoint), Merge heads b18 and b8a
(...many more old revisions)
在我看来,这是一部完美的历史。 alembic heads 报告a04c53fd8c74 (label_1, label_2) (head)。
唯一让我觉得奇怪的是我的 alembic 版本的 db 中有两个值;
my_postgres=# SELECT * FROM alembic_version;
version_num
--------------
a04c53fd8c74
453d88f67d34
(2 rows)
我可以通过谷歌搜索异常找到的唯一参考是source code,我不想通读它。
这种情况怎么会发生?我应该如何解决它? “重叠”是什么意思?
【问题讨论】:
标签: alembic