High Performance PostgreSQL for Rails: wrong migration code sample (page 115)

@andatki

class AddTripRatingCheckConstraint < ActiveRecord::Migration[7.0]
  def change
    add_check_constraint :users, "rating >= 1 AND rating <= 5",
                                 name: "rating_check"
  end
end

add_check_constraint :users, should be add_check_constraint :trips,

1 Like