mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
closed #2335
This commit is contained in:
@@ -19,7 +19,7 @@ var db = require('./database'),
|
||||
schemaDate, thisSchemaDate,
|
||||
|
||||
// IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema
|
||||
latestSchema = Date.UTC(2014, 9, 22);
|
||||
latestSchema = Date.UTC(2014, 9, 31);
|
||||
|
||||
Upgrade.check = function(callback) {
|
||||
db.get('schemaDate', function(err, value) {
|
||||
@@ -1145,7 +1145,29 @@ Upgrade.upgrade = function(callback) {
|
||||
winston.info('[2014/10/22] Topic post count migration skipped');
|
||||
next();
|
||||
}
|
||||
},
|
||||
function(next) {
|
||||
thisSchemaDate = Date.UTC(2014, 9, 31);
|
||||
if (schemaDate < thisSchemaDate) {
|
||||
winston.info('[2014/10/31] Applying newbiePostDelay values');
|
||||
|
||||
async.series([
|
||||
async.apply(Meta.configs.setOnEmpty, 'newbiePostDelay', '120'),
|
||||
async.apply(Meta.configs.setOnEmpty, 'newbiePostDelayThreshold', '3')
|
||||
], function(err) {
|
||||
if (err) {
|
||||
winston.error('[2014/10/31] Error encountered while Applying newbiePostDelay values');
|
||||
return next(err);
|
||||
}
|
||||
winston.info('[2014/10/31] Applying newbiePostDelay values done');
|
||||
Upgrade.update(thisSchemaDate, next);
|
||||
});
|
||||
} else {
|
||||
winston.info('[2014/10/31] Applying newbiePostDelay values skipped');
|
||||
next();
|
||||
}
|
||||
}
|
||||
// Meta.configs.setOnEmpty = function (field, value, callback) {
|
||||
// Add new schema updates here
|
||||
// IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema IN LINE 22!!!
|
||||
], function(err) {
|
||||
|
||||
Reference in New Issue
Block a user