add onupgradeneeded function

add onupgradeneeded function