script for the local couch db