10

I'm writing a node CRUD app that requires a few CouchDB views (I'm using express and cradle).

I've got the node app itself controlled with git, but my DB views are currently uncontrolled.

What's the recommended way to put these under source control? I don't want to put the entire database (including data) under source control.

MikeRand
  • 4,788
  • 9
  • 41
  • 70

3 Answers3

6

Take a look at couchapp, http://couchapp.org/. You can use that to push your version-controlled design docs to a database.

Matt Goodall
  • 1,682
  • 10
  • 7
0

Maybe useful: also CouchApp may push some docs in db. For example, doc(s) of configure or demo. For that put file in folder '_docs' (the same level with 'lists', 'shows', etc.) in JSON format.

File: 'any-configure.json'

{
    "_id": "any-configure",
    "fieldA": "...",
    "fieldB": "...",
    ...
}
0

As pointed, using couchapp could make it easier to work with design documents. I have implemented a similar approach in a Java project, an example here and the class that manages these documents.

ahmedyha
  • 328
  • 1
  • 4
  • 8