fixed database upgrade scripts