diff --git a/src/upgrade.js b/src/upgrade.js index aa24a732c0..ea9aba4250 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -19,7 +19,7 @@ var db = require('./database'), schemaDate, thisSchemaDate, // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema - latestSchema = Date.UTC(2014, 2, 21); + latestSchema = Date.UTC(2014, 3, 31, 12, 30); Upgrade.check = function(callback) { db.get('schemaDate', function(err, value) { @@ -516,6 +516,24 @@ Upgrade.upgrade = function(callback) { winston.info('[2014/3/21] Removing gids and pruning groups - skipped'); next(); } + }, + function(next) { + thisSchemaDate = Date.UTC(2014, 3, 31, 12, 30); + + if (schemaDate < thisSchemaDate) { + db.setObjectField('widgets:global', 'footer', "[{\"widget\":\"html\",\"data\":{\"html\":\"\",\"title\":\"\",\"container\":\"\"}}]", function(err) { + if (err) { + winston.error('[2014/3/31] Problem re-adding copyright message into global footer widget'); + next(); + } else { + winston.info('[2014/3/31] Re-added copyright message into global footer widget'); + Upgrade.update(thisSchemaDate, next); + } + }); + } else { + winston.info('[2014/3/31] Re-adding copyright message into global footer widget - skipped'); + next(); + } } // Add new schema updates here // IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema IN LINE 22!!!