refine db migration, add uninstall routine