Fix schema upgrade issue