Skip to content
sinnerschrader edited this page Feb 5, 2012 · 1 revision

Migrating from v0.1

We have changed the structure of game documents. They're still compatible, but you can update your existing docs with this script to get rid of the waste...

    var db = $.couch.db("yourdatabase");
    db.allDocs({
      include_docs: true,
      success: function(ret) {
        var rows = ret.rows;
        for (var i = 0; i < rows.length; ++i) {
          var doc = rows[i].doc;
          if (doc.type === "game") {
            delete doc.league;
            db.saveDoc(doc);
          }
        }
      }
    });

If you are using Futon, go there and run the code in your Browser's Console.

Clone this wiki locally