提交 8b2a5990 编写于 作者: Y Yves Senn

Merge pull request #18269 from cuppincake/getting-started-migration-update

Update Getting Started guide to reflect foreign key in migration [ci skip]
......@@ -1544,6 +1544,7 @@ class CreateComments < ActiveRecord::Migration
t.timestamps null: false
end
add_foreign_key :comments, :articles
end
end
```
......@@ -1563,6 +1564,8 @@ run against the current database, so in this case you will just see:
== CreateComments: migrating =================================================
-- create_table(:comments)
-> 0.0115s
-- add_foreign_key(:comments, :articles)
-> 0.0000s
== CreateComments: migrated (0.0119s) ========================================
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册