1 2 3 4 5 6 7
class AddPaymentToOrder < ActiveRecord::Migration[7.0] def change change_table(:orders) do |t| t.references :payment, null: false, foreign_key: true end end end