http://api.rubyonrails.org/classes/ActiveRecord/Migration.html
rails generate migration add_fieldname_to_tablename fieldname:stringThis will generate the filetimestamp_add_fieldname_to_tablename, which will look like this:class AddFieldnameToTablename < ActiveRecord::Migration def up add_column :tablenames, :fieldname, :string end def down remove_column :tablenames, :fieldname end end
0 comments:
Post a Comment