adjusting for changes to nokogiri, and properly accounting for sql constraints