Skip to content

Conversation

@jedahu
Copy link
Contributor

@jedahu jedahu commented Apr 25, 2012

Added a :code-version key to the options of view-server-fns. If the existing document contains a :code-version field, save-design-document will only update to the new document if its :code-version value is greater. Otherwise the existing document is returned.

Added a :code-version key to the options of view-server-fns. If the
existing document contains a :code-version field, save-design-document
will only update to the new document if its :code-version value is
greater. Otherwise the existing document is returned.
@jedahu
Copy link
Contributor Author

jedahu commented Apr 26, 2012

I'm pulling this, it needs more thought...

@jedahu jedahu closed this Apr 26, 2012
@cemerick
Copy link
Contributor

This is a good idea, and I've wanted something like it in the past. I'm reopening the issue. Hopefully you, me, or someone else will think up a proper design/api soon.

@cemerick cemerick reopened this Apr 30, 2012
@kenrestivo
Copy link

Leaving breadcrumbs here: According to some CouchDB folks on IRC (rnewson and jan), views aren't actually reindexed unless a hash of the working parts of the design document-- map, reduce, language, includes, etc.-- changes. The filename of the design doc on disk is that hash.

So that reduces the need for versioning; you can blindly (save-view) in clutch endlessly and it won't reindex or rebuild those views unless that hash changes. If (save-view) returns a new _rev, I'm told that's just a pointer to the same document, because it wasn't any different than the old one (if I'm understanding this correctly).

it still would be good to have view revisions that sync with the source code revisions, and it's good to know that adding another custom revision to a design document won't actually cause anything to get reindexed.

But for my purposes, just brute-force running (save-view) on all my views in a function that runs at every deploy works for the moment.

@jedahu
Copy link
Contributor Author

jedahu commented May 1, 2012

Ah. Good to know. In the long term I'd still like versioning because among other things, it protects against accidental downgrades.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants