目标数据库不是最新的 [英] Target database is not up to date
问题描述
我想为Flask应用程序进行迁移。
然而,我收到以下错误。
<$ c $目标数据库不是最新的。
在线上,我读到它与此有关。
http://alembic.zzzcomputing.com/zh/latest/cookbook.html#building-an-up-to-date-database-from-scratch
<不幸的是,我不太了解如何让数据库保持最新,以及在哪里/如何编写链接中给出的代码。如果您有迁移的经验,可以给我解释一下吗?
谢谢 - autogenerate
,您必须将其应用于 alembic upgrade head
。如果在shell中使用了 db.create_all()
,可以使用 alembic stamp head
来表示当前状态的数据库表示所有迁移的应用程序。
I'd like to make a migration for a Flask app. I am using Alembic.
However, I receive the following error.
Target database is not up to date.
Online, I read that it has something to do with this. http://alembic.zzzcomputing.com/en/latest/cookbook.html#building-an-up-to-date-database-from-scratch
Unfortunately, I don't quite understand how to get the database up to date and where/how I should write the code given in the link. If you have experience with migrations, can you please explain this for me
Thanks
After creating a migration, either manually or as --autogenerate
, you must apply it with alembic upgrade head
. If you used db.create_all()
from a shell, you can use alembic stamp head
to indicate that the current state of the database represents the application of all migrations.
这篇关于目标数据库不是最新的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!