|
|
|
@ -586,6 +586,14 @@ Upgrade.upgrade = function(callback) {
|
|
|
|
|
if (schemaDate < thisSchemaDate) {
|
|
|
|
|
updatesMade = true;
|
|
|
|
|
|
|
|
|
|
db.exists('topics:tid', function(err, exists) {
|
|
|
|
|
if(err) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
if(!exists) {
|
|
|
|
|
winston.info('[2014/2/14] Upgraded topics to sorted set - skipped');
|
|
|
|
|
return next();
|
|
|
|
|
}
|
|
|
|
|
db.getSetMembers('topics:tid', function(err, tids) {
|
|
|
|
|
if(err) {
|
|
|
|
|
return next(err);
|
|
|
|
@ -609,6 +617,7 @@ Upgrade.upgrade = function(callback) {
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
winston.info('[2014/2/14] Upgrade topics to sorted set - skipped');
|
|
|
|
|
next();
|
|
|
|
@ -620,6 +629,15 @@ Upgrade.upgrade = function(callback) {
|
|
|
|
|
if (schemaDate < thisSchemaDate) {
|
|
|
|
|
updatesMade = true;
|
|
|
|
|
|
|
|
|
|
db.exists('users:joindate', function(err, exists) {
|
|
|
|
|
if(err) {
|
|
|
|
|
return next(err);
|
|
|
|
|
}
|
|
|
|
|
if(!exists) {
|
|
|
|
|
winston.info('[2014/2/14] Added posts to sorted set - skipped');
|
|
|
|
|
return next();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
db.getSortedSetRange('users:joindate', 0, -1, function(err, uids) {
|
|
|
|
|
if(err) {
|
|
|
|
|
return next(err);
|
|
|
|
@ -649,6 +667,7 @@ Upgrade.upgrade = function(callback) {
|
|
|
|
|
next();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
winston.info('[2014/2/14] Added posts to sorted set - skipped');
|
|
|
|
|