10th Mon
衝突したマイグレーション番号を振りなおすプラグイン
今では、このプラグインのお世話になるような状況にはならなくなった
のですが、多人数で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を使ってる場合でも対応できる
ようにするのは難しくなさそうです。
使い方
まずは、以下のコマンドでプラグインをインストールします。
pre>>
% ./script/plugin install http://rails.sanityinc.com/plugins/renumber_migrations
<<--
あとは、Rakeタスクを実行するだけです。
pre>>
% rake db:migrate:renumber
<<--
posted by
genki on Mon 10 Dec 2007 at 00:21 with 0 comments