Fix sql upgrade tests