Fixed an upgradedatabase bug

Upgrade database wont delete from tables that dont exist