Changeset [7216] introduced a new convention for generating migrations. It was good, but however, not very useful.
This patch extends the idea further to add optional list of attribute pairs as arguments.
So now when you do :
script/generate migration AddMoreToPost title:string body:text published:boolean
Generated migration will look like :
class AddMoreToPost < ActiveRecord::Migration
def self.up
add_column :posts, :title, :string
add_column :posts, :body, :text
add_column :posts, :published, :boolean
end
def self.down
remove_column :posts, :published
remove_column :posts, :body
remove_column :posts, :title
end
end
The patch also removes the functionality of Changeset [7216] as I believe this approach is a better one.
Thanks.