diff --git a/src/upgrade.js b/src/upgrade.js index 80aecf6352..21e9ffde51 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -19,7 +19,7 @@ var db = require('./database'), schemaDate, thisSchemaDate, // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema - latestSchema = Date.UTC(2014, 9, 31); + latestSchema = Date.UTC(2014, 10, 6, 18, 30); Upgrade.check = function(callback) { db.get('schemaDate', function(err, value) { @@ -1166,6 +1166,46 @@ Upgrade.upgrade = function(callback) { winston.info('[2014/10/31] Applying newbiePostDelay values skipped'); next(); } + }, + function(next) { + thisSchemaDate = Date.UTC(2014, 10, 6, 18, 30); + if (schemaDate < thisSchemaDate) { + winston.info('[2014/10/31] Updating topic authorship sorted set'); + + async.waterfall([ + async.apply(db.getObjectField, 'global', 'nextTid'), + function(nextTid, next) { + var tids = []; + for(var x=1,numTids=nextTid-1;x