Fixed upgrade database