Get current database version correctly.

Record version upgrades in the database.