rails generate migration references code example
Example 1: Add references rails migration
class AddUserToUploads < ActiveRecord::Migration
def change
add_reference :uploads, :user, index: true
end
end
Example 2: Add references rails migration
rails g migration AddUserToUploads user:references