From ddccc20f2f1ed366995ce9fadc4ec5ae8a193590 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Wed, 27 Nov 2013 10:45:10 -0500 Subject: change parsing of design documents to work with a layout that would allow for a naming scheme where the directory name is the database name, and the file name is the design doc name: eg. users/User.json should end up in users/_design/User This will allow us to use different design docs per database for different purposes. eg. users/_design/User for the data schema and views and users/_design/write_restricted for validations that prevent certain couch users from writing and users/_design/filters for filters that filter the changes stream for things like tapicero to only receive the relevant changes. --- load_design_documents.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/load_design_documents.sh b/load_design_documents.sh index 147eda1..28e8742 100755 --- a/load_design_documents.sh +++ b/load_design_documents.sh @@ -2,6 +2,7 @@ for file in `find /srv/leap/couchdb/designs -type f -name \*.json` do - db=`basename $file .json` - /usr/local/bin/couch-doc-update --host 127.0.0.1:5984 --db $db --id _security --data '{}' --file $file + db=${file%/*} + db=${db##*/} + echo "/usr/local/bin/couch-doc-update --host 127.0.0.1:5984 --db $db --id _security --data '{}' --file $file" done -- cgit v1.2.3