From aaaffb823f352f9f85793f482e3ff8a64d90a09c Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Sat, 7 Dec 2013 13:11:59 -0500 Subject: [PATCH 1/2] upgrading markdown minver --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index af257f5775..c7ba9b9586 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "uglify-js": "~2.4.0", "validator": "~1.5.1", "nodebb-plugin-mentions": "~0.1.15", - "nodebb-plugin-markdown": "~0.1.9", + "nodebb-plugin-markdown": "~0.2.0", "nodebb-theme-vanilla": "~0.0.9", "nodebb-theme-cerulean": "0.0.10", "cron": "~1.0.1" From 40e71299a1b61137abdf9a18aaf4f065311929bb Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Mon, 9 Dec 2013 12:39:36 -0500 Subject: [PATCH 2/2] closes #642 --- src/upgrade.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/upgrade.js b/src/upgrade.js index 75265c4643..d3b938743e 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -38,7 +38,8 @@ Upgrade.upgrade = function(callback) { Upgrade.upgradeRedis = function(callback) { - var RDB = db.client; + var RDB = db.client, + updatesMade = false; winston.info('Beginning Redis database schema update'); @@ -52,6 +53,7 @@ Upgrade.upgradeRedis = function(callback) { function(next) { thisSchemaDate = new Date(2013, 9, 3).getTime(); if (schemaDate < thisSchemaDate) { + updatesMade = true; async.series([ function(next) { RDB.keys('uid:*:notifications:flag', function(err, keys) { @@ -110,6 +112,7 @@ Upgrade.upgradeRedis = function(callback) { function(next) { thisSchemaDate = new Date(2013, 9, 23).getTime(); if (schemaDate < thisSchemaDate) { + updatesMade = true; RDB.keys('notifications:*', function(err, keys) { keys = keys.filter(function(key) { @@ -139,6 +142,7 @@ Upgrade.upgradeRedis = function(callback) { function(next) { thisSchemaDate = new Date(2013, 10, 11).getTime(); if (schemaDate < thisSchemaDate) { + updatesMade = true; RDB.hset('config', 'postDelay', 10, function(err, success) { winston.info('[2013/11/11] Updated postDelay to 10 seconds.'); next(); @@ -151,6 +155,7 @@ Upgrade.upgradeRedis = function(callback) { function(next) { thisSchemaDate = new Date(2013, 10, 22).getTime(); if (schemaDate < thisSchemaDate) { + updatesMade = true; RDB.keys('category:*', function(err, categories) { async.each(categories, function(categoryStr, next) { var hex; @@ -197,6 +202,7 @@ Upgrade.upgradeRedis = function(callback) { function(next) { thisSchemaDate = new Date(2013, 10, 26).getTime(); if (schemaDate < thisSchemaDate) { + updatesMade = true; categories.getAllCategories(0, function(err, categories) { function updateIcon(category, next) { @@ -237,7 +243,7 @@ Upgrade.upgradeRedis = function(callback) { thisSchemaDate = new Date(2013, 11, 2).getTime(); if (schemaDate < thisSchemaDate) { - + updatesMade = true; var keys = [ 'global:next_user_id', 'next_topic_id', @@ -276,14 +282,18 @@ Upgrade.upgradeRedis = function(callback) { winston.info('[2013/12/2] Update to global keys skipped'); next(); } - }, + } // Add new schema updates here // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema IN LINE 12!!! ], function(err) { if (!err) { RDB.set('schemaDate', thisSchemaDate, function(err) { if (!err) { - winston.info('[upgrade] Redis schema update complete!'); + if(updatesMade) { + winston.info('[upgrade] Redis schema update complete!'); + } else { + winston.info('[upgrade] Redis schema already up to date!'); + } if (callback) { callback(err); } else {