navigation - upgrade script

v1.18.x
psychobunny 10 years ago
parent 9a24110a37
commit 3be5242aa1

@ -21,7 +21,7 @@ var db = require('./database'),
schemaDate, thisSchemaDate, schemaDate, thisSchemaDate,
// IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema
latestSchema = Date.UTC(2015, 1, 24, 1); latestSchema = Date.UTC(2015, 1, 25);
Upgrade.check = function(callback) { Upgrade.check = function(callback) {
db.get('schemaDate', function(err, value) { db.get('schemaDate', function(err, value) {
@ -941,6 +941,25 @@ Upgrade.upgrade = function(callback) {
winston.info('[2015/02/24] Upgrading privilege groups to system groups skipped'); winston.info('[2015/02/24] Upgrading privilege groups to system groups skipped');
next(); next();
} }
},
function(next) {
thisSchemaDate = Date.UTC(2015, 1, 25);
if (schemaDate < thisSchemaDate) {
updatesMade = true;
winston.info('[2015/02/25] Upgrading menu items to dynamic navigation system');
require('./navigation/admin').save(require('../install/data/navigation.json'), function(err) {
if (err) {
return next(err);
}
winston.info('[2015/02/25] Upgrading menu items to dynamic navigation system done');
Upgrade.update(thisSchemaDate, next);
});
} else {
winston.info('[2015/02/25] Upgrading menu items to dynamic navigation system skipped');
next();
}
} }
// Add new schema updates here // Add new schema updates here

Loading…
Cancel
Save