docs: function upgradeData(schemaVersion, dataVersion, ref, data, locals) {
    const name = isComponent(ref) ? getComponentName(ref) : getLayoutName(ref),
      dir = isComponent(ref) ? files.getComponentPath(name) : files.getLayoutPath(name), // Get the component directory
      upgradeFile = files.tryRequire(path.resolve(dir, 'upgrade')); // Grab the the upgrade.js file
  
    var transforms = [];
  
  
    log('debug', `Running upgrade for ${name}: ${ref}`);
    // If no upgrade file exists, exit early
    if (!upgradeFile) {
      log('debug', `No upgrade file found for component: ${name}`);
      return bluebird.resolve(data);
    }
  
    // find all the transforms that have to be performed (object.keys)
    transforms = aggregateTransforms(schemaVersion, dataVersion, upgradeFile);
  
    // If no transforms need to be run, exit early
    if (!transforms.length) {
      log('debug', `Upgrade tried to run, but no upgrade function was found for ${name}`, {
        component: name,
        currentVersion: dataVersion,
        schemaVersion
      });
      return bluebird.resolve(data);
    }
  
    // pass through the transform
    return runTransforms(transforms, upgradeFile, ref, data, locals)
      .then(saveTransformedData(ref))
      .catch(e => {
        throw e;
      });
  }