diff options
author | Micah Anderson <micah@riseup.net> | 2013-11-27 10:45:10 -0500 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2013-11-27 10:45:10 -0500 |
commit | ddccc20f2f1ed366995ce9fadc4ec5ae8a193590 (patch) | |
tree | ae8bebb8cf03f5b41ab1ffb364032eadba7c50af | |
parent | fd4b9eaa87a947789b5a1e639bac05199cc4ee79 (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-x | load_design_documents.sh | 5 |
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 |