From dad95b3fd2edd5660ca0b9c6a02b58e757be0545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Rynning-T=C3=B8nnesen?= Date: Tue, 27 Feb 2018 11:41:53 +0100 Subject: [PATCH] Informing about the new update --- README.md | 2 ++ server/apps/rewrite.js | 8 -------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b524a754..096b1501 100755 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ in ```/server/config```. There are ```*.example.js``` files for all the ones men If you want to use Google Analytics, have a look at ```analytics.example.js``` in ```server/config/```. +If you have run the server before the table-structures where added, please run ```node server/apps/rewrite.js```. This will fix any crashes that occurs because of faulty document-collectionnames due to moving channel-settings to a separate collection. + Use ```$ npm start``` to start the server. (Alternative you can use the ```pm2.json``` in the project-root, if you prefer pm2 for running the apps.) ### About diff --git a/server/apps/rewrite.js b/server/apps/rewrite.js index 782b728e..9bc0b17f 100644 --- a/server/apps/rewrite.js +++ b/server/apps/rewrite.js @@ -8,17 +8,9 @@ db.getCollectionNames(function(err, docs) { } }) -/*function delete(name) { - db.collection(name).remove(function(err, doc) { - - }) -}*/ - function makeNewAndDelete(name) { db.collection(name).find({views: {$exists: true}}, function(err, doc) { - //console.log(doc); if(doc.length == 0) { - //console.log(name); } else if(doc.length == 1) { db.collection(name + "_settings").insert(doc[0], function(err, result){ console.log("Result insert", result);