Google Groups Home
Help | Sign in
String migration plugin available for pre-alpha testing
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Bill Katz  
View profile
(1 user)  More options Nov 13 2006, 3:21 am
From: "Bill Katz" <billk...@gmail.com>
Date: Mon, 13 Nov 2006 00:21:58 -0800
Local: Mon, Nov 13 2006 3:21 am
Subject: [Mephisto] String migration plugin available for pre-alpha testing
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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google