今では、このプラグインのお世話になるような状況にはならなくなった のですが、多人数でRailsアプリケーションを開発している場合には 便利なプラグインかもしれません。

Renumber clashing Rails migrations in one easy step

If you work in a team on a Rails project, chances are that you and your team mates occasionally create identically-numbered migrations. Renumbering a migration that you're working on is a pain, unless you're using this handy 'renumber_migrations' plugin.

このプラグインを使うと、マイグレーション番号が衝突した場合に、 Subversionのリポジトリを確認して、あるべき順序に番号を 振りなおしてくれます。

Subversionを使って管理していないプロジェクトでは使えないですが、 ちょっとソースを書き換えれば他のSCMを使ってる場合でも対応できる ようにするのは難しくなさそうです。

使い方

まずは、以下のコマンドでプラグインをインストールします。

   1  % ./script/plugin install http://rails.sanityinc.com/plugins/renumber_migrations

あとは、Rakeタスクを実行するだけです。

   1  % rake db:migrate:renumber

posted by Png genki on Mon 10 Dec 2007 at 00:20

Comments:

or Preview
Social Bookmarks
  • Delicious
  • B_entry255
  • Clip_16_12_w
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ