upgrade script to rename widgets:home.tpl to widgets:categories.tpl

v1.18.x
barisusakli 10 years ago
parent df7c48c474
commit 150d33eb92

@ -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, 8); latestSchema = Date.UTC(2015, 1, 17);
Upgrade.check = function(callback) { Upgrade.check = function(callback) {
db.get('schemaDate', function(err, value) { db.get('schemaDate', function(err, value) {
@ -827,6 +827,25 @@ Upgrade.upgrade = function(callback) {
winston.info('[2015/02/08] Clearing reset tokens skipped'); winston.info('[2015/02/08] Clearing reset tokens skipped');
next(); next();
} }
},
function(next) {
thisSchemaDate = Date.UTC(2015, 1, 17);
if (schemaDate < thisSchemaDate) {
updatesMade = true;
winston.info('[2015/02/17] renaming home.tpl to categories.tpl');
db.rename('widgets:home.tpl', 'widgets:categories.tpl', function(err) {
if (err) {
return next(err);
}
winston.info('[2015/02/17] renaming home.tpl to categories.tpl done');
Upgrade.update(thisSchemaDate, next);
});
} else {
winston.info('[2015/02/17] renaming home.tpl to categories.tpl skipped');
next();
}
} }
// Add new schema updates here // Add new schema updates here

Loading…
Cancel
Save