As I have reported on the rubyonrails-core mailing list, I have a working solution. Right now, this is a patch against Rails Edge. I am trying to move this code into a plugin, but I have problems with dependencies. I override methods in Rails::Generator::Base, but there is no file named rails/generator/base.rb. That constant is defined in rails_generator/commands.rb, which makes it very hard for the ActiveSupport dependency mechanism to load it.

In the hopes that someone could show me the way, I am making the patch available through the Rails Trac on issue #6838. The patch is timestamped_migrations.v1.patch

What this patch does:

  • Generates migrations where the version number is replaced with a UTC timestamp;
  • Allows migrating up and down, ordering migrations by name;
  • Records which migrations were run in the schema_migrations table.

This patch has no tests, but from the command line it seems to work. It even works with the db:sessions:create Rake task.

Enjoy, and either leave comments here or at francois.beausoleil@gmail.com.

2006-12-13 Update: Opened a new ticket as #6838, from #6799.

Search

Your Host

A picture of me

I am François Beausoleil, a Ruby on Rails and Scala developer. During the day, I work on Seevibes, a platform to measure social interactions related to TV shows. At night, I am interested many things. Read my biography.

Top Tags

Books I read and recommend

Links

Projects I work on

Projects I worked on