Branchable migrations -- A plugin to let you organize your migrations

I just put a new plugin named branchable_migrations on Github. Branchable migrations lets you separate your migrations into "branches" (i.e., a director under db/migrate) that each have their own version. Using the forthcoming UTC timestamped migrations and this plugin, you can separate migrations by table or feature. Doing so should alleviate many of the problems that seem to pike up when working on teams and using migrations for everything.

For example, if your db directory looked this:

  db/     migrate/       001_create_things.rb       002_create_pandas.rb         branch1/           001_create_comments.rb           002_create_replies.rb         branch2/           001_create_posts.rb

Then running rake db:migrate would look like this:

Jeremy -

I just put a new plugin named branchable_migrations on Github. Branchable migrations lets you separate your migrations into "branches" (i.e., a director under db/migrate) that each have their own version. Using the forthcoming UTC timestamped migrations and this plugin, you can separate migrations by table or feature. Doing so should alleviate many of the problems that seem to pike up when working on teams and using migrations for everything.

For example, if your db directory looked this:

db/    migrate/      001_create_things.rb      002_create_pandas.rb        branch1/          001_create_comments.rb          002_create_replies.rb        branch2/          001_create_posts.rb

Then running rake db:migrate would look like this:

nice thinking Jeremy.

I wonder if this could be used to more easily coordinate developers (rather than IMing "I'm creating a migration #202!").

But I think for this use-case we'd want to run all 001's, then all 002's, etc.

Or do you think your system could apply?

Jodi

That wouldn't be hard to hack in. Possibly like a "rake db:migrate SYNC=true" would run the same versions across all branches. What do you think?

--Jeremy

Jeremy -