forked from hblank/digitalfoosball
-
Notifications
You must be signed in to change notification settings - Fork 0
Migration Notes
sinnerschrader edited this page Feb 5, 2012
·
1 revision
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.