aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/getting_started.md
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2015-06-28 11:52:59 +0200
committerXavier Noria <fxn@hashref.com>2015-06-28 12:12:28 +0200
commitfd495a8d180b4fdeff55292f961e0b35071d42e3 (patch)
tree7607040e01b43e64178c24d068b587df726fff08 /guides/source/getting_started.md
parent6a6c4c459106e2d9b76dd1233133a2bf30866ab0 (diff)
downloadrails-fd495a8d180b4fdeff55292f961e0b35071d42e3.tar.gz
rails-fd495a8d180b4fdeff55292f961e0b35071d42e3.tar.bz2
rails-fd495a8d180b4fdeff55292f961e0b35071d42e3.zip
updates a migration example in the Getting Started guide [ci skip]
Closes #20705.
Diffstat (limited to 'guides/source/getting_started.md')
-rw-r--r--guides/source/getting_started.md8
1 files changed, 3 insertions, 5 deletions
diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md
index a091f84fb0..dfdc11de7a 100644
--- a/guides/source/getting_started.md
+++ b/guides/source/getting_started.md
@@ -1546,8 +1546,6 @@ class CreateComments < ActiveRecord::Migration
create_table :comments do |t|
t.string :commenter
t.text :body
-
- # this line adds an integer column called `article_id`.
t.references :article, index: true, foreign_key: true
t.timestamps null: false
@@ -1556,9 +1554,9 @@ class CreateComments < ActiveRecord::Migration
end
```
-The `t.references` line sets up a foreign key column for the association between
-the two models. An index for this association is also created on this column.
-Go ahead and run the migration:
+The `t.references` line creates an integer column called `article_id`, an index
+for it, and a foreign key constraint that points to the `articles` table. Go
+ahead and run the migration:
```bash
$ bin/rake db:migrate