Some folks may have the same issue as me when tailoring Mephisto, so I
thought I'd mention a plugin that modifies ActiveRecord migrations to
use strings for ordering instead of numbers.
Traditionally, migrations are ordered by an integer at the beginning
of the file name:
001_sweet_lovin_tables.rb
002_add_more_sugar.rb
This plugin allows you to order migrations by using a string at the
beginning of a migration file:
001_sweet_lovin_tables.rb
001a_add_bobby_specialized_table.rb <---- added locally
002_add_more_sugar.rb
String ordering is useful when working on branches of a project. Let's
say someone wanted to customize Mephisto. They might use svk, a
distributed version control system built on subversion, to create a
local mirror of the Mephisto trunk. But as soon as the local version
added a migration, there'd be a conflict in numbering between the new
local migration and any new migration in Mephisto trunk. This issue is
solved by using this plugin with a simple naming convention: add
alphabetical extensions after the migration number.
I've made the modifications, packaged it as a plugin, but still need
to add tests. I've tried it on a test and real app and it works ok.
You'll have to manually change the schema_info :version field to a
string. Also the rake db:migrate command only moves between integral
versions (but does so correctly). E-mail me if you want the code at
this early stage.
-Bill