gpt4 book ai didi

alembic - 目标数据库不是最新的

转载 作者:IT老高 更新时间:2023-10-28 20:29:41 26 4
gpt4 key购买 nike

我想为 Flask 应用程序进行迁移。我正在使用 Alembic。

但是,我收到以下错误。

Target database is not up to date.

在线,我读到这与此有关。 http://alembic.zzzcomputing.com/en/latest/cookbook.html#building-an-up-to-date-database-from-scratch

不幸的是,我不太了解如何使数据库最新以及在链接中的何处/应该如何编写代码。

最佳答案

创建迁移后,手动或作为 --autogenerate ,您必须使用 alembic upgrade head 应用它.如果您使用了 db.create_all()在 shell 中,您可以使用 alembic stamp head表示数据库的当前状态代表所有迁移的应用程序。

关于alembic - 目标数据库不是最新的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17768940/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com