Agile Web Development

Build it. Launch it. Love it.

Independent Migrations

In simple terms, here’s what it does. To paraphrase zenspider, if two migrations have the same number, Rails will bitch at you. This plugin removes the bitching. To get it working, install, then edit your migrations so they look like this

  class AddProject < ActiveRecord::IndependentMigration

That’s it. Now your migration directory can look something like

  002_add_project.rb
  002.add_monkeys.rb
  003.fix_monkeys.rb

and as long as all 002 are independent, then the migration will run. This patch is only guaranteed for Rails 1.2.3 and may change as ActiveRecord changes as it relies heavily on monkeypatching (or reopening classes, as David Black would have you believe) some private methods.

Vitals

Home http://blog.caboo.se/articles/2007/3/27/independent-migrations-plugin
Repository svn://caboo.se/plugins/court3nay/independent_migrations
License
Tags Tag_red
Rating (1 vote)
Owner Courtenay
Created 27 March 2007

Comments

Add a comment