diff --git a/src/upgrade.js b/src/upgrade.js index 117b79848e..6e7751847a 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -21,7 +21,7 @@ var db = require('./database'), schemaDate, thisSchemaDate, // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema - latestSchema = Date.UTC(2015, 1, 17); + latestSchema = Date.UTC(2015, 1, 23); Upgrade.check = function(callback) { db.get('schemaDate', function(err, value) { @@ -859,6 +859,24 @@ Upgrade.upgrade = function(callback) { winston.info('[2015/02/17] renaming home.tpl to categories.tpl skipped'); next(); } + }, + function(next) { + thisSchemaDate = Date.UTC(2015, 1, 23); + if (schemaDate < thisSchemaDate) { + db.setAdd('plugins:active', 'nodebb-rewards-essentials', function(err) { + winston.info('[2015/2/23] Activating NodeBB Essential Rewards'); + Plugins.reload(function() { + if (err) { + next(err); + } else { + Upgrade.update(thisSchemaDate, next); + } + }); + }); + } else { + winston.info('[2015/2/23] Activating NodeBB Essential Rewards - skipped'); + next(); + } } // Add new schema updates here