Skip to content

Commit

Permalink
Merge pull request #16592 from aditya-kapoor/fix-migration-docs
Browse files Browse the repository at this point in the history
[ci skip] correct docs about the migration generation
  • Loading branch information
spastorino committed Aug 20, 2014
2 parents cd1a045 + 2858e31 commit 2b7d67d
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions activerecord/lib/active_record/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,21 +161,14 @@ def initialize
# in the <tt>db/migrate/</tt> directory where <tt>timestamp</tt> is the
# UTC formatted date and time that the migration was generated.
#
# You may then edit the <tt>up</tt> and <tt>down</tt> methods of
# MyNewMigration.
#
# There is a special syntactic shortcut to generate migrations that add fields to a table.
#
# rails generate migration add_fieldname_to_tablename fieldname:string
#
# This will generate the file <tt>timestamp_add_fieldname_to_tablename</tt>, which will look like this:
# class AddFieldnameToTablename < ActiveRecord::Migration
# def up
# add_column :tablenames, :fieldname, :string
# end
#
# def down
# remove_column :tablenames, :fieldname
# def change
# add_column :tablenames, :field, :string
# end
# end
#
Expand Down

0 comments on commit 2b7d67d

Please sign in to comment.