Oops, refreshes.exercise_id was supposed to be an integer.  Also schema.rb was missing default on repos.is_not_found.