diff --git a/src/utils/upgradeUtils.js b/src/utils/upgradeUtils.js index f0a3717..971f374 100644 --- a/src/utils/upgradeUtils.js +++ b/src/utils/upgradeUtils.js @@ -35,27 +35,23 @@ module.exports.upgradeCheck = async function(){ //Get the server statistics document from Database const stats = await statModel.getStats(); - //Throw this flag if an upgrade is initiated to automagically and silently initiate all upgrades after it - let upgradeStarted = false; - //If we're upgrading from Panama Red (or older) if(stats.version == "<0.2.0"){ //Initiate upgrade procedure from Panama Red await upgradePanamaRed(); - - //Throw upgrade started flag - upgradeStarted = true; } //If we upgraded - if(upgradeStarted){ + if(stats.version != package.version){ //Update the statistics document to reflect the new version stats.version = package.version; //Write the statistics document to the DB await stats.save(); + + //Shout about successfuly upgrade + loggerUtils.consoleShout(`Database Upgrading to ${package.canopyDisplayVersion} Complete!`); } - loggerUtils.consoleShout(`Database Upgrading to ${package.canopyDisplayVersion} Complete!`); } /**