class AddTokenToRoles < ActiveRecord::Migration[6.1] def change add_column :roles, :token, :text Rol.find_each { |m| m.update_column( :token, SecureRandom.hex(64) ) } end end