Make this as a global variable, as now we test for the database long before we need to upgrade it.