# HG changeset patch # User Dirk Olmes # Date 1314583921 -7200 # Node ID a5bda54309ba0e9cc61321abf98c0e9caed4fb1f # Parent 3eeda7cec39b1e00a0d610ca7b1f416c063ae142 add a couchapp for easy/automated setup diff -r 3eeda7cec39b -r a5bda54309ba backend/couchdb/CouchApp/feedworm/.couchappignore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/CouchApp/feedworm/.couchappignore Mon Aug 29 04:12:01 2011 +0200 @@ -0,0 +1,8 @@ +[ + // filenames matching these regexps will not be pushed to the database + // uncomment to activate; separate entries with "," + // ".*~$" + // ".*\\.swp$" + // ".*\\.bak$" + "setup.sh" +] diff -r 3eeda7cec39b -r a5bda54309ba backend/couchdb/CouchApp/feedworm/.couchapprc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/CouchApp/feedworm/.couchapprc Mon Aug 29 04:12:01 2011 +0200 @@ -0,0 +1,7 @@ +{ + "env" : { + "local" : { + "db" : "http://localhost:5984/feedworm" + } + } +} diff -r 3eeda7cec39b -r a5bda54309ba backend/couchdb/CouchApp/feedworm/_id --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/CouchApp/feedworm/_id Mon Aug 29 04:12:01 2011 +0200 @@ -0,0 +1,1 @@ +_design/feedworm \ No newline at end of file diff -r 3eeda7cec39b -r a5bda54309ba backend/couchdb/CouchApp/feedworm/setup.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/CouchApp/feedworm/setup.sh Mon Aug 29 04:12:01 2011 +0200 @@ -0,0 +1,14 @@ +#!/bin/bash + + +BASE_URL=${1:-http://localhost:5984} +DB_URL=${BASE_URL}/feedworm + +# create the database if it doesn't yet exist +curl -f "${DB_URL}" > /dev/null 2>&1 +if [ $? -gt 0 ]; then + echo -n "creating the database ... " + curl -X PUT ${DB_URL} +fi + +couchapp push local diff -r 3eeda7cec39b -r a5bda54309ba backend/couchdb/CouchApp/feedworm/views/feedEntries_by_feed/map.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/CouchApp/feedworm/views/feedEntries_by_feed/map.js Mon Aug 29 04:12:01 2011 +0200 @@ -0,0 +1,7 @@ +function(doc) +{ + if (doc.doctype == "feedEntry") + { + emit(doc.feed, doc) + } +} diff -r 3eeda7cec39b -r a5bda54309ba backend/couchdb/CouchApp/feedworm/views/feedEntry_by_link/map.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/CouchApp/feedworm/views/feedEntry_by_link/map.js Mon Aug 29 04:12:01 2011 +0200 @@ -0,0 +1,7 @@ +function(doc) +{ + if (doc.doctype == "feedEntry") + { + emit(doc.link, doc) + } +} diff -r 3eeda7cec39b -r a5bda54309ba backend/couchdb/CouchApp/feedworm/views/feeds/map.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/CouchApp/feedworm/views/feeds/map.js Mon Aug 29 04:12:01 2011 +0200 @@ -0,0 +1,7 @@ +function(doc) +{ + if (doc.doctype == "feed") + { + emit(doc._id, doc) + } +} diff -r 3eeda7cec39b -r a5bda54309ba backend/couchdb/CouchApp/feedworm/views/preference/map.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/CouchApp/feedworm/views/preference/map.js Mon Aug 29 04:12:01 2011 +0200 @@ -0,0 +1,7 @@ +function(doc) +{ + if (doc.doctype == "preferences") + { + emit(doc._id, doc) + } +} diff -r 3eeda7cec39b -r a5bda54309ba backend/couchdb/CouchApp/feedworm/views/unread_feedEntries_by_feed/map.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/backend/couchdb/CouchApp/feedworm/views/unread_feedEntries_by_feed/map.js Mon Aug 29 04:12:01 2011 +0200 @@ -0,0 +1,7 @@ +function(doc) +{ + if (doc.doctype == "feedEntry" && doc.read == false) + { + emit(doc.feed, doc) + } +}