Fix the upgrade queries even though upgrade is not (yet) used

/me is dumb at times.