From cfaa0b37542cb97a6e2db2d55cda2ae3a0ec8e69 Mon Sep 17 00:00:00 2001 From: Micheil Smith Date: Sun, 9 Feb 2014 21:25:28 +0000 Subject: [PATCH] Added schema upgrade to delete the tid:lastFeedUpdate key --- src/upgrade.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/upgrade.js b/src/upgrade.js index 8fa94af00b..332c2844dc 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -560,6 +560,25 @@ Upgrade.upgrade = function(callback) { winston.info('[2014/2/7] Updating category recent replies -- skipped'); next(); } + }, + function(next) { + thisSchemaDate = new Date(2014, 1, 9, 20, 50).getTime(); + if (schemaDate < thisSchemaDate) { + updatesMade = true; + + db.delete('tid:lastFeedUpdate', function(err, uids) { + if(err) { + winston.err('Error upgrading '+ err.message); + process.exit(); + } else { + winston.info('[2014/2/9] Remove Topic LastFeedUpdate value, as feeds are now on-demand'); + next(); + } + }); + } else { + winston.info('[2014/2/9] Remove Topic LastFeedUpdate value, as feeds are now on-demand - skipped'); + next(); + } } // Add new schema updates here // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema IN LINE 17!!!