//mongeez formatted javascript
//changeset ymh:002-set_schema_version-001-002


db.nodes.find().snapshot().forEach(
    function(node) {
        node.style = node.color ? {color: node.color} : {};
        delete node.color;
        db.nodes.save(node);
    }
);

db.edges.find().snapshot().forEach(
    function(edge) {
        edge.style = edge.color ? {color: edge.color} : {};
        delete edge.color;
        db.edges.save(edge);
    }
);

db.projects.update(
    {},
    { $set: {
        schema_version: "2"
        }
    },
    false,
    true
);
