Duplicate Migrations plugin

Plugin details

Duplicate migrations allows rails migrations to have duplicate version numbers. It works off the assumption that duplicate versions never have dependencies on each other, so can be run in any order. This is useful for situations like branching and merging, where large number of a duplicate migrations are created.

During install, the plugin creates a "schema_infos" table (runs the rake task db:convert:allow_duplicates), where each row represents the name of a migration that has been run. It then migrates data about the current version number from schema_info into schema_infos.

After install, you should be able to migrate normally with rake db:migrate. Except for the caution section below, the only difference is that the system will now allow duplicate version numbers.

You can add migrations at any version, even if there are gaps in version numbers. You can now make all your create_table migrations share version 1, if you'd like.

Websitehttp://www.elctech.com/2007/11/7/duplicate-migrations-in-rails Repositoryhttp://wush.net/svn/public/plugins/duplicate_migrations Author David Stevenson Tags Migrations LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://wush.net/svn/public/plugins/duplicate_migrations

CAUTION
=================
* Do not rename your migrations unless you modify their entries schema_infos as well (not recommended)!
* Do not allow dependencies between migrations with the same version number! A migration should only be dependent on versions strictly smaller than it, as the run ordering of migrations with the same version not guaranteed.


RAKE TASKS
=================

  rake db:migrate - Migrate supporting duplicate migrations
  rake db:old_migrate - Migrate the traditional rails way (don't mix!)
  rake db:convert:allow_duplicates - Copy version information from schema_info to schema_infos
  rake db:convert:disallow_duplicates - Copy version information from schema_infos to schema_info
  rake db:cleanup:delete_duplicates - Deletes the schema_infos table
  rake db:cleanup:delete_nonduplicates - Deletes the schema_info table

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: scott, 3 months ago