Storage upgrade should save database version in the system table in the database and commit upgrades only of higher versions.