incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Wex <si...@simonwex.com>
Subject Re: Best way to "migrate" (a la Rails) Couch documents
Date Fri, 06 Mar 2009 19:54:19 GMT
I actually have something written that does this. Currently the
"migration" language is ruby, my plans were to contribute this, but I
wanted to switch over to using using SpiderMonkey first. Unfortunately
deadlines always seem to get in the way of intentions. We're using it
on production data.

I'll package it up this eve and share it.

Cheers, Simon.
http://zeepmobile.com

On Fri, Mar 6, 2009 at 11:25 AM, Troy Kruthoff <tkruthoff@gmail.com> wrote:
>
> On Mar 6, 2009, at 10:05 AM, Jason Smith wrote:
>
>> Hi, list.
>>
>> While I am happy to be learning Couch for a new project, I am still unsure
>> about some tricks that I used with Django and Rails, such as data migration:
>>
>> For example, suppose I change my code and instead of using a string
>> timestamp in my documents, I would prefer a hash with "day", "month", and
>> "year" keys.  When I deploy the new code into production, obviously I want
>> the data structures to change for all existing documents.
>>
>
> Also keep in mind that another option is to "wrap" your json docs in a
> language specific object for access, and you can use this layer to this
> transformation at runtime and leave the data alone.  As for querying, couch
> allows you to emit values to a view (such as a d/m/y hash) instead of the
> timestamp.
>
> This has the obvious advantage of immediate deployment without first having
> to do a migration.  Which by the way, is very similar to how attribs can be
> added or removed, without touching the actual data store.
>
> -- troy
>
>
>

Mime
View raw message