sql/upgrade: don't update SQL version

unless previous SQL commands succeeded