new upgrade directive

v1.18.x
Julian Lam 11 years ago
parent b6aa31b245
commit ee6ac77f8b

@ -17,7 +17,7 @@ var db = require('./database'),
Upgrade.check = function(callback) { Upgrade.check = function(callback) {
// IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema
var latestSchema = new Date(2014, 0, 13, 12, 0).getTime(); var latestSchema = new Date(2014, 0, 19, 22, 19).getTime();
db.get('schemaDate', function(err, value) { db.get('schemaDate', function(err, value) {
if (parseInt(value, 10) >= latestSchema) { if (parseInt(value, 10) >= latestSchema) {
@ -281,6 +281,24 @@ Upgrade.upgrade = function(callback) {
winston.info('[2014/1/13] Set up "Registered Users" user group - skipped'); winston.info('[2014/1/13] Set up "Registered Users" user group - skipped');
next(); next();
} }
},
function(next) {
thisSchemaDate = new Date(2014, 0, 19, 22, 19).getTime();
if (schemaDate < thisSchemaDate) {
updatesMade = true;
db.getObjectValues('username:uid', function(err, uids) {
async.each(uids, function(uid, next) {
db.searchRemove('user', uid, next);
}, function(err) {
winston.info('[2014/1/19] Remove user search from Reds');
next();
});
});
} else {
winston.info('[2014/1/19] Remove user search from Reds -- skipped');
next();
}
} }
// Add new schema updates here // Add new schema updates here
// IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema IN LINE 17!!! // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema IN LINE 17!!!

Loading…
Cancel
Save