mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
a03ea684ef
Changes `rails g model Post user:references` from def change create_table :posts do |t| t.references :user, index: true end add_foreign_key :posts, :users end to def change create_table :posts do |t| t.references :user, index: true, foreign_key: true end end Changes `rails g migration add_user_to_posts user:references` from def change add_reference :posts, :users, index: true add_foreign_key :posts, :users end to def change add_reference :posts, :users, index: true, foreign_key: true end |
||
---|---|---|
.. | ||
active_record | ||
active_record.rb |