reorganized db upgrade scripts