是否有与 django-evolution 等效的 SQLAlchemy?
我想要的只是拥有一个类似于以下内容的工作流程:
- 将 django_evolution 添加到项目的 INSTALLED_APPS
- 运行 ./manage.pysyncdb
- 对项目中的模型文件进行修改
- 运行 ./manage.py进化 --hint --execute
其中非常简单,尽管它不支持高级功能(如多个数据库),但它确实知道如何添加/删除列,这是常见的用例。
相比之下,sqlalchemy-migrate 的工作流程极其复杂,两个教程 (1、2) 文档引用的内容要么已过时,要么不相关。
All I want is to have a workflow somewhat similar to:
- Add django_evolution to the INSTALLED_APPS for your project
- Run ./manage.py syncdb
- Make modifications to the model files in your project
- Run ./manage.py evolve --hint --execute
Which is super simple and even though it doesn't support advanced features (like multiple databases) it does know how to add/remove columns which is a common use case.
sqlalchemy-migrate has an insanely complex workflow in comparison and both tutorials (1, 2) referenced by the docs are either outdated or irrelevant.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想您已经尝试过 DJango 了:)。这些是当前 SQLAlchemy 尚不具备的功能。 @madjar 建议您可以使用 Alembic 的开发版本,也可以使用 sqlalchemy-migrate。相关帖子已经在堆栈溢出中。
I think you already tried your hand on DJango :). These are the functionality right now not available with current SQLAlchemy. Suggested by @madjar you can use development version of Alembic or you can use sqlalchemy-migrate. Relevant post is already in stack overflow.
SQLAlchemy 的创建者最近开始开发 Alembic。虽然它还很年轻(版本 0.1),但它可能适合您的需求。
The creator of SQLAlchemy recently started working on Alembic. While it's still young (version 0.1), it may suits your needs.