|
|
|
@ -810,6 +810,17 @@ Upgrade.upgrade = function(callback) {
|
|
|
|
|
if (schemaDate < thisSchemaDate) {
|
|
|
|
|
winston.info('[2014/6/17] Upgrading category post counts...');
|
|
|
|
|
|
|
|
|
|
db.getSortedSetRange('categories:cid', 0, -1, function(err, cids) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async.each(cids, function(cid, next) {
|
|
|
|
|
db.setObjectField('category:' + cid, 'post_count', 0, next);
|
|
|
|
|
}, function(err) {
|
|
|
|
|
if (err) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
db.getSortedSetRange('topics:tid', 0, -1, function(err, tids) {
|
|
|
|
|
function upgradeTopic(tid, callback) {
|
|
|
|
|
|
|
|
|
@ -844,6 +855,8 @@ Upgrade.upgrade = function(callback) {
|
|
|
|
|
Upgrade.update(thisSchemaDate, next);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
winston.info('[2014/6/17] Category post count upgrade - skipped');
|
|
|
|
|
next();
|
|
|
|
|