Fix migration crash when script_version is nil.