class AddInvitedByToUser < ActiveRecord::Migration[6.1] def change add_reference(:users, :inviter, foreign_key: { to_table: :users }) end end