Refact do_deploy_db() #2