24 points · by dbla · 13y ago · 13 comments
EDIT: ah, perhaps this is just for systems that don't have such native schema migration support (e.g. raw PHP apps)? Though I'm still not sure how comfortable I would be separating schema version from deployed code version.
The grand vision is that you won't ever have to write migrations again. You'll just modify your database and DevJoist keeps track of everything. You switch branches and DevJoist knows to update your database environment accordingly.
I think storing a version of your schema in VCS is a great idea and it solves part of the problem. If I need to set up a new dev environment I can just run the full schema and I'm good to go.
Ok so now I've got my new database set up and one of my teammates, Sally, makes a change. She writes a change script and maybe updates the base schema as well. This means that she has to keep track of the changes she's made all along the way (DevJoist does this for you).
But what if another teammate, Joe, also makes a change. Now I've got two change scripts to run, I'm not necessarily sure in what order, and my base schema has a potential conflict. DevJoist won't let you commit a change to the schema unless you've merged in the most recent revision of the schema - and gives you a really slick GUI for doing the merging. The merge tool lets you pick and choose which tables, columns, indexes, column properties etc. you want from each version, and then combines them together.
Kind of long winded - sorry, but does that answer your question at all?
Until then I'll just use https://github.com/thuss/standalone-migrations with my non-Rails projects.
Automatic synching of changes with your databases so that when you save a new version, your database environment is automatically updated.
Git-style branching.
Versioning of your data (if you're storing any metadata in your db).