lib/services/upgrade.js
function aggregateTransforms(schemaVersion, currentVersion, upgradeFile) {
  var transformVersions = generateVersionArray(upgradeFile),
    applicableVersions = [];

  for (let i = 0; i < transformVersions.length; i++) {
    let version = transformVersions[i];

    if (!currentVersion && schemaVersion || schemaVersion >= version && version > currentVersion) {
      applicableVersions.push(transformVersions[i]);
    }
  }

  return applicableVersions;
}
function aggregateTransforms(schemaVersion, currentVersion, upgradeFile) {
  var transformVersions = generateVersionArray(upgradeFile),
    applicableVersions = [];

  for (let i = 0; i < transformVersions.length; i++) {
    let version = transformVersions[i];

    if (!currentVersion && schemaVersion || schemaVersion >= version && version > currentVersion) {
      applicableVersions.push(transformVersions[i]);
    }
  }

  return applicableVersions;
}
function aggregateTransforms ( schemaVersion , currentVersion , upgradeFile ) { var transformVersions = generateVersionArray ( upgradeFile ) , applicableVersions = [ ] ; for ( let i = 0 ; i < transformVersions . length ; i ++ ) { let version = transformVersions [ i ] ; if ( ! currentVersion && schemaVersion || schemaVersion >= version && version > currentVersion ) { applicableVersions . push ( transformVersions [ i ] ) ; } } return applicableVersions ; }
Iterate through the array of version transforms provided
and determine which versions are valid to be run.

- If the data has no current version but the schema declares
one, then run it
- If the current schema version is greater than the current
version AND the tranform version is greater than the current
version, run it.

@param  {Number} schemaVersion
@param  {Number} currentVersion
@param  {Object} upgradeFile
@return {Array}
Iterate through the array of version transforms provided and determine which versions are valid to be run .