From ff2e7ead0982b4db01680536ff3392b1abe2a02a Mon Sep 17 00:00:00 2001 From: John McLear Date: Thu, 25 Oct 2012 09:40:33 -0700 Subject: add a script to migrate from dirtyDB to MYSQL thanks to http://blog.codeborne.com --- bin/migrateDirtyDBtoMySQL.js | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 bin/migrateDirtyDBtoMySQL.js diff --git a/bin/migrateDirtyDBtoMySQL.js b/bin/migrateDirtyDBtoMySQL.js new file mode 100644 index 00000000..f2bc8efe --- /dev/null +++ b/bin/migrateDirtyDBtoMySQL.js @@ -0,0 +1,11 @@ +var dirty = require("../src/node_modules/ueberDB/node_modules/dirty")('var/dirty.db'); +var db = require("../src/node/db/DB"); + +db.init(function() { + db = db.db; + dirty.on("load", function() { + dirty.forEach(function(key, value) { + db.set(key, value); + }); + }); +}); -- cgit v1.2.3