0

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?

Lionel
  • 3,188
  • 5
  • 27
  • 40

2 Answers2

4

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.

Benjamin Wohlwend
  • 30,958
  • 11
  • 90
  • 100
1

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

bua
  • 4,761
  • 1
  • 26
  • 32