1 2 3 4 5
class AddReplyToComment < ActiveRecord::Migration[7.0] def change add_reference :comments, :reply_to, foreign_key: { to_table: :comments } end end