rails g migration add reference 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: rails g migration add columns
$ rails generate migration AddDetailsToProducts part_number:string price:decimal