/** * Creates a registry of config upgrades used by the code below. * * MODIFY THIS CODE HERE TO CREATE A NEW UPGRADE PATH FROM X to Y * YOU MUST ALSO MODIFY THE VERSION DECLARATIONS IN config_upgrade.h * * Caveats: * - All upgrade paths must eventually lead to the exact same version range of * min and max compatible versions. * - This resulting version range must be equal to: * make_pair(MIN_COMPATIBLE_CONFIG_VERSION, CURRENT_CONFIG_VERSION) * - There must always be an upgrade path from the empty version (0) to the latest * config version. * * If any of the above is false, we fassert and fail to start. */ ConfigUpgradeRegistry createRegistry() { ConfigUpgradeRegistry registry; // v0 to v7 Upgrade v0ToV7(0, VersionRange(6, 7), doUpgradeV0ToV7); registry.insert(make_pair(v0ToV7.fromVersion, v0ToV7)); // v6 to v7 Upgrade v6ToV7(6, VersionRange(6, 7), doUpgradeV6ToV7); registry.insert(make_pair(v6ToV7.fromVersion, v6ToV7)); validateRegistry(registry); return registry; }
/** * Creates a registry of config upgrades used by the code below. * * MODIFY THIS CODE HERE TO CREATE A NEW UPGRADE PATH FROM X to Y * YOU MUST ALSO MODIFY THE VERSION DECLARATIONS IN config_upgrade.h * * Caveats: * - All upgrade paths must eventually lead to the exact same version range of * min and max compatible versions. * - This resulting version range must be equal to: * make_pair(MIN_COMPATIBLE_CONFIG_VERSION, CURRENT_CONFIG_VERSION) * - There must always be an upgrade path from the empty version (0) to the latest * config version. * * If any of the above is false, we fassert and fail to start. */ ConfigUpgradeRegistry createRegistry() { ConfigUpgradeRegistry registry; // v0 to v4 Upgrade v0ToV4(0, VersionRange(3, 4), doUpgradeV0ToV4); registry.insert(make_pair(v0ToV4.fromVersion, v0ToV4)); // v3 to v4 Upgrade v3ToV4(3, VersionRange(3, 4), doUpgradeV3ToV4); registry.insert(make_pair(v3ToV4.fromVersion, v3ToV4)); validateRegistry(registry); return registry; }
/** * Creates a registry of config upgrades used by the code below. * * MODIFY THIS CODE HERE TO CREATE A NEW UPGRADE PATH FROM X to Y * YOU MUST ALSO MODIFY THE VERSION DECLARATIONS IN config_upgrade.h * * Caveats: * - All upgrade paths must eventually lead to the exact same version range of * min and max compatible versions. * - This resulting version range must be equal to: * make_pair(MIN_COMPATIBLE_CONFIG_VERSION, CURRENT_CONFIG_VERSION) * - There must always be an upgrade path from the empty version (0) to the latest * config version. * * If any of the above is false, we fassert and fail to start. */ ConfigUpgradeRegistry createRegistry() { ConfigUpgradeRegistry registry; // v0 to v5 Upgrade v0ToV5(0, VersionRange(4, 5), doUpgradeV0ToV5); registry.insert(make_pair(v0ToV5.fromVersion, v0ToV5)); // v4 to v5 Upgrade v4ToV5(4, VersionRange(4, 5), doUpgradeV4ToV5); registry.insert(make_pair(v4ToV5.fromVersion, v4ToV5)); validateRegistry(registry); return registry; }