One of the painful things about working with any database-oriented project in production is that you can't just drop the database and re-create every time you have a schema change. (Of course, you
could do that, but your users might get a little miffed when their data disappears.) Rails and Django have for this reason had support for migrating from one schema version to another. Well, now SQLAlchemy has a automatic migrations tool by the name of Miruku. I haven't tried it, and it's an extremely early version (0.1a7), but it looks promising. Have a look
here, and let me know what you think.
I do not think Django has any short of schema change support. The developer must issue all their own SQL commands to keep the tables in sync with the Django models.
ReplyDeleteAlthough they have been adding lots of nice stuff for the 1.0 push. Perhaps I am using outdated experience.
You may also want to take a look at:
ReplyDeletehttp://code.google.com/p/sqlalchemy-migrate/
which has been around for a while, and has the same goals.
TG2 has been including this migration library for a little while, but we haven't documented how to use it :(
pete and mark,
ReplyDeleteThanks for the comments. As to Django, I guess I must have confused Rails migrations with Django. As for sqlalchemy-migrate, thanks for the pointer. I remember hearing about it before, but I wasn't too familiar with it. It looks like sqlalchemy-migrate even supports automatic script generation. I wonder if the two projects could benefit from one another...?
Django has several tools for migrating schemas. One of my favourites:
ReplyDeletehttp://code.google.com/p/deseb/
@manuel - Thanks for the tip!
ReplyDeleteI found this to be a great quickstart on sqlalchemy-migrate : http://spyced.blogspot.com/2008/07/sqlalchemy-migrate-for-dummies.html
ReplyDeletehmm, that link might work better as sqlalchemy migrate for dummies
ReplyDeleteAFAIK, Django will have migrations in 1.0, it's recently been checked in.
ReplyDelete