Add upgrade-database script and DatabaseUpgrader class.