gpt4 book ai didi

sqlalchemy - 没有数据库的 Alembic 迁移

转载 作者:行者123 更新时间:2023-12-01 04:58:14 27 4
gpt4 key购买 nike

是否可以使用 Alembic auto-generate migrations没有访问数据库的权限?

例如 django/south 可以通过 comparing the current version of a Model against a previous snapshot of the Model 做到这一点.

最佳答案

不,这是不可能的。在 the relevant issue zzzeek 说

while the reflection-based comparison has its issues, it really is a very fundamental assumption these days particularly in the openstack world where autogen features are used in unit test suites to ensure the migrated schema matches the model. I don't have plans right now to pursue the datafile-based approach, it would be an enormous undertaking for a system that people seem to be mostly OK with as is.



尽管另一种方法可能是按需启动一个新数据库,从空到头运行迁移,针对它生成,然后丢弃数据库。

关于sqlalchemy - 没有数据库的 Alembic 迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35329752/

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