nsc: deploy_db: refactored deploy_db to return correct code