rails g model User name:index email:uniq token:string{6} age:integer
name:indexcreates an indexed column calledname.email:uniqcreates column calledemailwith a unique index.- Specifying
token:string{6}constrains the length oftokento 6 chars.
class CreateUsers < ActiveRecord::Migration