Rails 4.2 again supports adding and removing foreign keys (in migrations), for example:
# add a foreign key to `articles.author_id` referencing `authors.id` add_foreign_key :articles, :authors
I do not understand: how is it
add_foreign_key :articles, :authors
different from this:
add_column :articles, :author_id, :integer
Thanks for any clarification!
ruby-on-rails migration ruby-on-rails-4 foreign-keys
Tomdogg
source share