当前位置: 动力学知识库 > 问答 > 编程问答 >

python - How do I Handle Database changes and port my data?

问题描述:

Example, for web applications using Turbogears and SQLAlchemy. Every time I update my data model, I need to delete my database and recreate it.

Is there an easy way to update the production database?

Do I have to write a custom script that transfers all the production data into a new database model? Or is there an easier way to upgrade a production database?

网友答案:

These database changes are called schema migrations. For SQLAlchemy, sqlalchemy-migrate is the defacto standard. Other ORMs/abstraction layers have similar solutions, e.g. South for Django.

网友答案:

You can ALTER TABLE, i think that's the easiest way.

分享给朋友:
您可能感兴趣的文章:
随机阅读: