change_table :books do |t| t.string :author # string型のauthor列を追加 t.remove :published, :cd # published, cd列をsか削除 t.index :title # title列にインデックスを追加 t.rename :isbn, :isbn_code # isbn列をisbn_code列にリネーム end rake db:migrate VERSION=20111005060806 #指定のバージョンになるようにマイグレーションを実行する rake db:migrate:reset # データベースを破棄し、マイグレーションファイルを再実行する