The upgrade script now upgrades the database in a background thread.