1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #18363 from andreynering/add-foreign-key-subsection-in-upgrading-guide

Adding subsection on 'Upgrading' guide about foreign key support

[ci skip]
This commit is contained in:
Yves Senn 2015-02-11 08:37:25 +01:00
commit 4a9301b3f2

View file

@ -276,6 +276,22 @@ class Notifier < ActionMailer::Base
end
```
### Foreign Key Support
The migration DSL has been expanded to support foreign key definitions. If
you've been using the Foreigner gem, you might want to consider removing it.
Note that the foreign key support of Rails is a subset of Foreigner. This means
that not every Foreigner definition can be fully replaced by it's Rails
migration DSL counterpart.
The migration procedure is as follows:
1. remove `gem "foreigner"` from the Gemfile.
2. run `bundle install`.
3. run `bin/rake db:schema:dump`.
4. make sure that `db/schema.rb` contains every foreign key definition with
the necessary options.
Upgrading from Rails 4.0 to Rails 4.1
-------------------------------------