summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2013-11-27 10:45:10 -0500
committerMicah Anderson <micah@riseup.net>2013-11-27 10:45:10 -0500
commitddccc20f2f1ed366995ce9fadc4ec5ae8a193590 (patch)
treeae8bebb8cf03f5b41ab1ffb364032eadba7c50af
parentfd4b9eaa87a947789b5a1e639bac05199cc4ee79 (diff)
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.
-rwxr-xr-xload_design_documents.sh5
1 files 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