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