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

Signed-off-by: emanuele <emanuele45@gmail.com>
Merge pull request #1907 from emanuele45/small_upgrade_fix

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