aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/migrations.textile
diff options
context:
space:
mode:
authorMikel Lindsaar <raasdnil@gmail.com>2010-03-11 22:07:48 +1100
committerMikel Lindsaar <raasdnil@gmail.com>2010-03-11 22:07:48 +1100
commit965fe59bff249ad91131a444e1fbd63dc4411db3 (patch)
treeec2d54d5eaad9e32bce1758e6a67c364279bbd39 /railties/guides/source/migrations.textile
parent79f02a473cb6aef00003745f23802314c8c89e7d (diff)
parent4adcbb6b2d6cef49ac28df4254ac74e09f14dcf7 (diff)
downloadrails-965fe59bff249ad91131a444e1fbd63dc4411db3.tar.gz
rails-965fe59bff249ad91131a444e1fbd63dc4411db3.tar.bz2
rails-965fe59bff249ad91131a444e1fbd63dc4411db3.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'railties/guides/source/migrations.textile')
-rw-r--r--railties/guides/source/migrations.textile10
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/guides/source/migrations.textile b/railties/guides/source/migrations.textile
index 771c3e2523..558cbb4771 100644
--- a/railties/guides/source/migrations.textile
+++ b/railties/guides/source/migrations.textile
@@ -105,7 +105,7 @@ h4. Creating a Model
The model and scaffold generators will create migrations appropriate for adding a new model. This migration will already contain instructions for creating the relevant table. If you tell Rails what columns you want then statements for adding those will also be created. For example, running
<shell>
-ruby script/generate model Product name:string description:text
+rails generate model Product name:string description:text
</shell>
will create a migration that looks like this
@@ -135,7 +135,7 @@ h4. Creating a Standalone Migration
If you are creating migrations for other purposes (for example to add a column to an existing table) then you can use the migration generator:
<shell>
-ruby script/generate migration AddPartNumberToProducts
+rails generate migration AddPartNumberToProducts
</shell>
This will create an empty but appropriately named migration:
@@ -153,7 +153,7 @@ end
If the migration name is of the form "AddXXXToYYY" or "RemoveXXXFromYYY" and is followed by a list of column names and types then a migration containing the appropriate +add_column+ and +remove_column+ statements will be created.
<shell>
-ruby script/generate migration AddPartNumberToProducts part_number:string
+rails generate migration AddPartNumberToProducts part_number:string
</shell>
will generate
@@ -173,7 +173,7 @@ end
Similarly,
<shell>
-ruby script/generate migration RemovePartNumberFromProducts part_number:string
+rails generate migration RemovePartNumberFromProducts part_number:string
</shell>
generates
@@ -193,7 +193,7 @@ end
You are not limited to one magically generated column, for example
<shell>
-ruby script/generate migration AddDetailsToProducts part_number:string price:decimal
+rails generate migration AddDetailsToProducts part_number:string price:decimal
</shell>
generates