Rails Adding Field/Column to Migration

rails generate migration add_fieldname_to_tablename fieldname:string

This will generate the file timestamp_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

After if you need to Change some Options or Add some others Fields/Columns you can Edit the file:
db/migrate/timestamp_my_new_migration.rb

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer