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

Great catch. The rating column is on the “trips” table, so the constraint should be added to that table and not “users.” We will get this fixed up! Thank you for submitting it.